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>
52 lines
1.8 KiB
Python
52 lines
1.8 KiB
Python
from __future__ import unicode_literals
|
|
|
|
from django.conf.urls import url
|
|
|
|
from .api_views import (
|
|
APIObjectACLListView, APIObjectACLPermissionListView,
|
|
APIObjectACLPermissionView, APIObjectACLView
|
|
)
|
|
from .views import (
|
|
ACLCreateView, ACLDeleteView, ACLListView, ACLPermissionsView
|
|
)
|
|
|
|
urlpatterns = [
|
|
url(
|
|
regex=r'^objects/(?P<app_label>[-\w]+)/(?P<model>[-\w]+)/(?P<object_id>\d+)/create/$',
|
|
name='acl_create', view=ACLCreateView.as_view()
|
|
),
|
|
url(
|
|
regex=r'^objects/(?P<app_label>[-\w]+)/(?P<model>[-\w]+)/(?P<object_id>\d+)/list/$',
|
|
name='acl_list', view=ACLListView.as_view()
|
|
),
|
|
url(
|
|
regex=r'^acls/(?P<acl_pk>\d+)/delete/$', name='acl_delete',
|
|
view=ACLDeleteView.as_view()
|
|
),
|
|
url(
|
|
regex=r'^acls/(?P<acl_pk>\d+)/permissions/$', name='acl_permissions',
|
|
view=ACLPermissionsView.as_view()
|
|
),
|
|
]
|
|
|
|
api_urls = [
|
|
url(
|
|
regex=r'^objects/(?P<app_label>[-\w]+)/(?P<model>[-\w]+)/(?P<object_id>\d+)/acls/$',
|
|
name='accesscontrollist-list', view=APIObjectACLListView.as_view()
|
|
),
|
|
url(
|
|
regex=r'^objects/(?P<app_label>[-\w]+)/(?P<model>[-\w]+)/(?P<object_id>\d+)/acls/(?P<acl_pk>\d+)/$',
|
|
name='accesscontrollist-detail', view=APIObjectACLView.as_view()
|
|
),
|
|
url(
|
|
regex=r'^objects/(?P<app_label>[-\w]+)/(?P<model>[-\w]+)/(?P<object_id>\d+)/acls/(?P<acl_pk>\d+)/permissions/$',
|
|
name='accesscontrollist-permission-list',
|
|
view=APIObjectACLPermissionListView.as_view()
|
|
),
|
|
url(
|
|
regex=r'^objects/(?P<app_label>[-\w]+)/(?P<model>[-\w]+)/(?P<object_id>\d+)/acls/(?P<acl_pk>\d+)/permissions/(?P<permission_pk>\d+)/$',
|
|
name='accesscontrollist-permission-detail',
|
|
view=APIObjectACLPermissionView.as_view()
|
|
),
|
|
]
|