Improve ACL navigation

Update the ACL delete icon for uniformity.

Insert both the ACL and object in the view to also
display the ACL permissions and delete view when
viewing the ACL of an object.

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-02-01 04:15:16 -04:00
parent f92d99bd9a
commit e5cd5a40c3
3 changed files with 18 additions and 8 deletions

View File

@@ -2,7 +2,9 @@ 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.common import (
MayanAppConfig, menu_object, menu_secondary, menu_sidebar
)
from mayan.apps.navigation import SourceColumn
from .classes import ModelPermission
@@ -35,7 +37,7 @@ class ACLsApp(MayanAppConfig):
)
menu_object.bind_links(
links=(link_acl_permissions, link_acl_delete),
links=(link_acl_permissions, link_acl_delete,),
sources=(AccessControlList,)
)
menu_sidebar.bind_links(

View File

@@ -2,7 +2,7 @@ from __future__ import absolute_import, unicode_literals
from mayan.apps.appearance.classes import Icon
icon_acl_delete = Icon(driver_name='fontawesome', symbol='minus')
icon_acl_delete = Icon(driver_name='fontawesome', symbol='times')
icon_acl_list = Icon(driver_name='fontawesome', symbol='lock')
icon_acl_new = Icon(
driver_name='fontawesome-dual', primary_symbol='lock',

View File

@@ -81,8 +81,12 @@ class ACLDeleteView(SingleObjectDeleteView):
pk_url_kwarg = 'acl_id'
def get_extra_context(self):
acl = self.get_object()
return {
'object': self.get_object().content_object,
'acl': acl,
'object': acl.content_object,
'navigation_object_list': ('object', 'acl'),
'title': _('Delete ACL: %s') % self.get_object(),
}
@@ -187,12 +191,16 @@ class ACLPermissionsView(AssignRemoveView):
)
def get_extra_context(self):
acl = self.get_object()
return {
'object': self.get_object().content_object,
'acl': acl,
'object': acl.content_object,
'navigation_object_list': ('object', 'acl'),
'title': _('Role "%(role)s" permission\'s for "%(object)s"') % {
'role': self.get_object().role,
'object': self.get_object().content_object,
},
'role': acl.role,
'object': acl.content_object,
}
}
def get_granted_list(self):