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