Instead of inserting the path of the apps into the Python app, the apps are now referenced by their full import path. This app name claves with external or native Python libraries. Example: Mayan statistics app vs. Python new statistics library. Every app reference is now prepended with 'mayan.apps'. Existing config.yml files need to be updated manually. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
39 lines
1.1 KiB
Python
39 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('AccessControlList')
|
|
|
|
SourceColumn(
|
|
source=AccessControlList, label=_('Role'), attribute='role'
|
|
)
|
|
SourceColumn(
|
|
source=AccessControlList, label=_('Permissions'),
|
|
attribute='get_permission_titles'
|
|
)
|
|
|
|
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',)
|
|
)
|