Update the entire with keyword arguments. Update the views to comply with MERC 6 by returning error 404 on access failure. API are untouched. Add icon to the ACL delete button. Add additional view tests. Use the new filtered choice form to display a select2 enabled role selection widget. Update the ACL creation view to not redirect to an existing ACL in case of duplication but to instead stop and display an error with a suggestion to the user to instead edit the existing ACL. Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
from __future__ import unicode_literals
|
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
from mayan.apps.common import MayanAppConfig, menu_object, menu_sidebar
|
|
from mayan.apps.navigation import SourceColumn
|
|
|
|
from .links import link_acl_create, link_acl_delete, link_acl_permissions
|
|
|
|
|
|
class ACLsApp(MayanAppConfig):
|
|
app_namespace = 'acls'
|
|
app_url = 'acls'
|
|
has_rest_api = True
|
|
has_tests = True
|
|
name = 'mayan.apps.acls'
|
|
verbose_name = _('ACLs')
|
|
|
|
def ready(self):
|
|
super(ACLsApp, self).ready()
|
|
|
|
AccessControlList = self.get_model(model_name='AccessControlList')
|
|
|
|
SourceColumn(
|
|
attribute='role', is_identifier=True, is_sortable=True,
|
|
source=AccessControlList
|
|
)
|
|
SourceColumn(
|
|
attribute='get_permission_titles', include_label=True,
|
|
source=AccessControlList
|
|
)
|
|
|
|
menu_object.bind_links(
|
|
links=(link_acl_permissions, link_acl_delete),
|
|
sources=(AccessControlList,)
|
|
)
|
|
menu_sidebar.bind_links(
|
|
links=(link_acl_create,), sources=('acls:acl_list',)
|
|
)
|