1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-27 10:53:02 +00:00
nk20/apps/permission/admin.py

32 lines
747 B
Python
Raw Normal View History

2020-03-07 12:12:17 +00:00
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-lateré
2019-09-18 12:26:42 +00:00
from django.contrib import admin
2020-03-20 13:43:35 +00:00
from .models import Permission, PermissionMask, RolePermissions
2020-03-19 15:12:52 +00:00
@admin.register(PermissionMask)
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)
class PermissionAdmin(admin.ModelAdmin):
"""
Admin customisation for Permission
"""
2020-03-20 13:43:35 +00:00
list_display = ('type', 'model', 'field', 'mask', 'description', )
@admin.register(RolePermissions)
class RolePermissionsAdmin(admin.ModelAdmin):
"""
Admin customisation for RolePermissions
"""
list_display = ('role', )