1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-30 12:23:00 +00:00
nk20/apps/permission/admin.py

34 lines
883 B
Python
Raw Normal View History

# Copyright (C) 2018-2021 by BDE ENS Paris-Saclay
2020-03-07 12:12:17 +00:00
# SPDX-License-Identifier: GPL-3.0-or-lateré
2019-09-18 12:26:42 +00:00
from django.contrib import admin
from note_kfet.admin import admin_site
2020-07-30 13:53:23 +00:00
2020-07-25 17:40:30 +00:00
from .models import Permission, PermissionMask, Role
2020-03-19 15:12:52 +00:00
@admin.register(PermissionMask, site=admin_site)
2020-03-19 15:12:52 +00:00
class PermissionMaskAdmin(admin.ModelAdmin):
"""
2020-03-20 13:43:35 +00:00
Admin customisation for PermissionMask
2020-03-19 15:12:52 +00:00
"""
2020-03-20 13:43:35 +00:00
list_display = ('description', 'rank', )
2019-09-18 14:40:21 +00:00
@admin.register(Permission, site=admin_site)
2019-09-18 14:40:21 +00:00
class PermissionAdmin(admin.ModelAdmin):
"""
Admin customisation for Permission
"""
2020-08-01 13:13:29 +00:00
list_display = ('description', 'type', 'model', 'field', 'mask', )
list_filter = ('type', 'mask', 'model',)
search_fields = ('description', 'field',)
2020-03-20 13:43:35 +00:00
@admin.register(Role, site=admin_site)
2020-07-25 17:40:30 +00:00
class RoleAdmin(admin.ModelAdmin):
2020-03-20 13:43:35 +00:00
"""
2020-07-25 17:40:30 +00:00
Admin customisation for Role
2020-03-20 13:43:35 +00:00
"""
2020-07-25 17:40:30 +00:00
list_display = ('name', )