Files
mayan-edms/mayan/apps/acls/apps.py
Roberto Rosario 8179c35189 Simplify test runner by adding a new option '--mayan-apps' that
automatically tests all Mayan apps that report to have tests.
Change the app flag that indicates when an app has test
from 'test' to the more explicit 'has_test'.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-03-14 23:47:40 -04:00

39 lines
1.1 KiB
Python

from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from common import MayanAppConfig, menu_object, menu_sidebar
from navigation import SourceColumn
from rest_api.classes import APIEndPoint
from .links import link_acl_create, link_acl_delete, link_acl_permissions
class ACLsApp(MayanAppConfig):
has_tests = True
name = 'acls'
verbose_name = _('ACLs')
def ready(self):
super(ACLsApp, self).ready()
APIEndPoint(app=self, version_string='1')
AccessControlList = self.get_model('AccessControlList')
SourceColumn(
source=AccessControlList, label=_('Permissions'),
attribute='get_permission_titles'
)
SourceColumn(
source=AccessControlList, label=_('Role'), attribute='role'
)
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',)
)