Add admin capcodes
Sometimes, it is necessary for an admin or other moderator to reveal themselves. Capcodes allow them to do so by appending a special colored portion at the end of their name on a post. This adds object-level permissions, so if you have a moderator who shouldn't be able to use the "admin" capcode, you can give them permission only to the "moderator" capcode. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -1,15 +1,10 @@
|
||||
from django.contrib import admin
|
||||
from django.urls import reverse
|
||||
from django.utils.safestring import mark_safe
|
||||
from board.models import (
|
||||
Ban,
|
||||
BanTemplate,
|
||||
Board,
|
||||
Post,
|
||||
RangeBan,
|
||||
ReportReason,
|
||||
ReportRecord,
|
||||
)
|
||||
|
||||
from guardian.admin import GuardedModelAdmin
|
||||
|
||||
from board.models import *
|
||||
|
||||
#
|
||||
# Admin sites
|
||||
@@ -82,3 +77,8 @@ class BanAdmin(admin.ModelAdmin):
|
||||
@admin.register(BanTemplate)
|
||||
class BanTemplateAdmin(admin.ModelAdmin):
|
||||
ordering = ("board__url", "name")
|
||||
|
||||
|
||||
@admin.register(Capcode)
|
||||
class CapcodeAdmin(GuardedModelAdmin):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user