Ejemplo n.º 1
0
from django.conf.urls.defaults import patterns, url
from django.utils.translation import ugettext_lazy as _

from common.views import MayanCreateView, MayanDeleteView, MayanListView, MayanUpdateView

from .models import Role
from .permissions import PERMISSION_ROLE_CREATE, PERMISSION_ROLE_EDIT, PERMISSION_ROLE_VIEW

urlpatterns = patterns(
    'permissions.views',
    url(r'^role/list/$',
        MayanListView.as_view(queryset=Role.objects.all(),
                              title=_('roles'),
                              global_permissions=[PERMISSION_ROLE_VIEW]),
        name='role_list'),
    url(r'^role/create/$',
        MayanCreateView.as_view(model=Role,
                                global_permissions=[PERMISSION_ROLE_CREATE]),
        name='role_create'),
    url(r'^role/(?P<role_id>\d+)/permissions/$',
        'role_permissions', (),
        name='role_permissions'),
    url(r'^role/(?P<role_id>\d+)/edit/$', 'role_edit', (), name='role_edit'),
    url(r'^role/(?P<role_id>\d+)/delete/$',
        'role_delete', (),
        name='role_delete'),
    url(r'^role/(?P<role_id>\d+)/members/$',
        'role_members', (),
        name='role_members'),
    url(r'^permissions/multiple/grant/$',
        'permission_grant', (),
Ejemplo n.º 2
0
from django.conf.urls.defaults import patterns, url
from django.utils.translation import ugettext_lazy as _

from common.views import MayanCreateView, MayanDeleteView, MayanListView, MayanUpdateView

from .models import Role
from .permissions import PERMISSION_ROLE_CREATE, PERMISSION_ROLE_EDIT, PERMISSION_ROLE_VIEW


urlpatterns = patterns('permissions.views',
    url(r'^role/list/$', MayanListView.as_view(queryset=Role.objects.all(), title=_('roles'), global_permissions=[PERMISSION_ROLE_VIEW]), name='role_list'),
    url(r'^role/create/$', MayanCreateView.as_view(model=Role, global_permissions=[PERMISSION_ROLE_CREATE]), name='role_create'),
    url(r'^role/(?P<role_id>\d+)/permissions/$', 'role_permissions', (), name='role_permissions'),
    url(r'^role/(?P<role_id>\d+)/edit/$', 'role_edit', (), name='role_edit'),
    url(r'^role/(?P<role_id>\d+)/delete/$', 'role_delete', (), name='role_delete'),
    url(r'^role/(?P<role_id>\d+)/members/$', 'role_members', (), name='role_members'),

    url(r'^permissions/multiple/grant/$', 'permission_grant', (), name='permission_multiple_grant'),
    url(r'^permissions/multiple/revoke/$', 'permission_revoke', (), name='permission_multiple_revoke'),
)
Ejemplo n.º 3
0
from __future__ import absolute_import

from django.conf.urls import patterns, url
from django.contrib.auth.models import User, Group
from django.utils.translation import ugettext_lazy as _

from common.views import MayanCreateView, MayanDeleteView, MayanListView, MayanUpdateView

from .models import Agency
#from .permissions import PERMISSION_GROUP_VIEW, PERMISSION_USER_VIEW

urlpatterns = patterns('agencies.views',
    url(r'^list/$', MayanListView.as_view(#global_permissions=[PERMISSION_USER_VIEW],
        title=_('agencies'),
        queryset=Agency.objects.all(),
        hide_link=True,
        multi_select_as_buttons=True), name='agency_list'),
    url(r'^add/$', 'agency_add', (), 'agency_add'),
    url(r'^(?P<agency_pk>\d+)/edit/$', 'agency_edit', (), 'agency_edit'),
    url(r'^(?P<agency_pk>\d+)/delete/$', 'agency_delete', (), 'agency_delete'),
    url(r'^multiple/delete/$', 'agency_multiple_delete', (), 'agency_multiple_delete'),

    url(r'^(?P<agency_pk>\d+)/position/list/$', 'position_list', (), 'position_list'),
    url(r'^(?P<agency_pk>\d+)/position/add/$', 'position_add', (), 'position_add'),
    url(r'^position/(?P<position_pk>\d+)/edit/$', 'position_edit', (), 'position_edit'),
    url(r'^position/(?P<position_pk>\d+)/delete/$', 'position_delete', (), 'position_delete'),

    url(r'^(?P<agency_pk>\d+)/department/list/$', 'department_list', (), 'department_list'),
    url(r'^(?P<agency_pk>\d+)/department/add/$', 'department_add', (), 'department_add'),
    url(r'^department/(?P<department_pk>\d+)/edit/$', 'department_edit', (), 'department_edit'),
    url(r'^department/(?P<department_pk>\d+)/delete/$', 'department_delete', (), 'department_delete'),
Ejemplo n.º 4
0
from django.conf.urls import patterns, url
from django.contrib.auth.models import User, Group
from django.utils.translation import ugettext_lazy as _

from common.views import MayanCreateView, MayanDeleteView, MayanListView, MayanUpdateView

from .permissions import PERMISSION_GROUP_VIEW, PERMISSION_USER_VIEW

urlpatterns = patterns(
    'user_management.views',
    url(r'^user/list/$',
        MayanListView.as_view(
            global_permissions=[PERMISSION_USER_VIEW],
            title=_('users'),
            queryset=User.objects.exclude(is_superuser=True).exclude(
                is_staff=True).order_by('username'),
            hide_link=True,
            multi_select_as_buttons=True),
        name='user_list'),
    url(r'^user/add/$', 'user_add', (), 'user_add'),
    url(r'^user/(?P<user_id>\d+)/edit/$', 'user_edit', (), 'user_edit'),
    url(r'^user/(?P<user_id>\d+)/delete/$', 'user_delete', (), 'user_delete'),
    url(r'^user/multiple/delete/$', 'user_multiple_delete', (),
        'user_multiple_delete'),
    url(r'^user/(?P<user_id>\d+)/set_password/$', 'user_set_password', (),
        'user_set_password'),
    url(r'^user/multiple/set_password/$', 'user_multiple_set_password', (),
        'user_multiple_set_password'),
    url(r'^user/(?P<user_id>\d+)/groups/$', 'user_groups', (), 'user_groups'),
    url(r'^group/list/$',
        MayanListView.as_view(global_permissions=[PERMISSION_GROUP_VIEW],
Ejemplo n.º 5
0
from django.conf.urls import patterns, url
from django.contrib.auth.models import User, Group
from django.utils.translation import ugettext_lazy as _

from common.views import MayanCreateView, MayanDeleteView, MayanListView, MayanUpdateView

from .permissions import PERMISSION_GROUP_VIEW, PERMISSION_USER_VIEW

urlpatterns = patterns('user_management.views',
    url(r'^user/list/$', MayanListView.as_view(global_permissions=[PERMISSION_USER_VIEW],
        title=_('users'),
        queryset=User.objects.exclude(is_superuser=True).exclude(is_staff=True).order_by('username'),
        hide_link=True,
        multi_select_as_buttons=True), name='user_list'),
    url(r'^user/add/$', 'user_add', (), 'user_add'),
    url(r'^user/(?P<user_id>\d+)/edit/$', 'user_edit', (), 'user_edit'),
    url(r'^user/(?P<user_id>\d+)/delete/$', 'user_delete', (), 'user_delete'),
    url(r'^user/multiple/delete/$', 'user_multiple_delete', (), 'user_multiple_delete'),
    url(r'^user/(?P<user_id>\d+)/set_password/$', 'user_set_password', (), 'user_set_password'),
    url(r'^user/multiple/set_password/$', 'user_multiple_set_password', (), 'user_multiple_set_password'),
    url(r'^user/(?P<user_id>\d+)/groups/$', 'user_groups', (), 'user_groups'),

    url(r'^group/list/$', MayanListView.as_view(global_permissions=[PERMISSION_GROUP_VIEW],
        title=_('groups'),
        queryset=Group.objects.all(),
        hide_link=True,
        multi_select_as_buttons=True), name='group_list'),
    url(r'^group/add/$', 'group_add', (), 'group_add'),
    url(r'^group/(?P<group_id>\d+)/edit/$', 'group_edit', (), 'group_edit'),
    url(r'^group/(?P<group_id>\d+)/delete/$', 'group_delete', (), 'group_delete'),
    url(r'^group/multiple/delete/$', 'group_multiple_delete', (), 'group_multiple_delete'),