2016-09-05 13:38:21 +00:00
|
|
|
from django.conf.urls import url
|
2016-11-09 11:29:15 +00:00
|
|
|
from rest_framework_bulk.routes import BulkRouter
|
2016-08-31 12:39:25 +00:00
|
|
|
import views
|
2016-08-25 05:28:02 +00:00
|
|
|
import api
|
2016-08-09 06:42:21 +00:00
|
|
|
|
|
|
|
app_name = 'users'
|
|
|
|
|
|
|
|
urlpatterns = [
|
2016-09-06 07:03:37 +00:00
|
|
|
url(r'^login$', views.UserLoginView.as_view(), name='login'),
|
|
|
|
url(r'^logout$', views.UserLogoutView.as_view(), name='logout'),
|
2016-09-06 08:55:57 +00:00
|
|
|
url(r'^password/forgot$', views.UserForgotPasswordView.as_view(), name='forgot-password'),
|
|
|
|
url(r'^password/forgot/sendmail-success$',
|
|
|
|
views.UserForgotPasswordSendmailSuccessView.as_view(), name='forgot-password-sendmail-success'),
|
2016-09-01 15:09:58 +00:00
|
|
|
url(r'^password/reset$', views.UserResetPasswordView.as_view(), name='reset-password'),
|
2016-09-05 13:38:21 +00:00
|
|
|
url(r'^password/reset/success$', views.UserResetPasswordSuccessView.as_view(),
|
|
|
|
name='reset-password-success'),
|
2016-11-09 11:29:15 +00:00
|
|
|
# User view
|
2016-09-04 08:05:58 +00:00
|
|
|
url(r'^user$', views.UserListView.as_view(), name='user-list'),
|
|
|
|
url(r'^user/(?P<pk>[0-9]+)$', views.UserDetailView.as_view(), name='user-detail'),
|
2016-09-16 17:04:52 +00:00
|
|
|
url(r'^user/(?P<pk>[0-9]+)/asset-permission$', views.UserAssetPermissionView.as_view(),
|
|
|
|
name='user-asset-permission'),
|
2016-09-17 05:04:26 +00:00
|
|
|
url(r'^user/(?P<pk>[0-9]+)/asset-permission/create$', views.UserAssetPermissionCreateView.as_view(),
|
|
|
|
name='user-asset-permission-create'),
|
2016-09-17 07:20:33 +00:00
|
|
|
url(r'^user/(?P<pk>[0-9]+)/granted-asset', views.UserGrantedAssetView.as_view(), name='user-granted-asset'),
|
2016-09-16 17:04:52 +00:00
|
|
|
url(r'^user/(?P<pk>[0-9]+)/login-history', views.UserDetailView.as_view(), name='user-login-history'),
|
2016-09-19 07:51:28 +00:00
|
|
|
url(r'^first-login/$', views.UserFirstLoginView.as_view(), name='user-first-login'),
|
2016-10-01 12:26:43 +00:00
|
|
|
url(r'^import/$', views.BulkImportUserView.as_view(), name='user-import'),
|
2016-09-19 07:51:28 +00:00
|
|
|
url(r'^user/(?P<pk>[0-9]+)/assets-perm$', views.UserDetailView.as_view(), name='user-detail'),
|
2016-09-06 06:38:19 +00:00
|
|
|
url(r'^user/create$', views.UserCreateView.as_view(), name='user-create'),
|
|
|
|
url(r'^user/(?P<pk>[0-9]+)/update$', views.UserUpdateView.as_view(), name='user-update'),
|
2016-11-09 11:29:15 +00:00
|
|
|
|
|
|
|
# User group view
|
2016-09-06 06:38:19 +00:00
|
|
|
url(r'^user-group$', views.UserGroupListView.as_view(), name='user-group-list'),
|
|
|
|
url(r'^user-group/(?P<pk>[0-9]+)$', views.UserGroupDetailView.as_view(), name='user-group-detail'),
|
|
|
|
url(r'^user-group/create$', views.UserGroupCreateView.as_view(), name='user-group-create'),
|
|
|
|
url(r'^user-group/(?P<pk>[0-9]+)/update$', views.UserGroupUpdateView.as_view(), name='user-group-update'),
|
2016-08-09 06:42:21 +00:00
|
|
|
]
|
2016-08-25 05:28:02 +00:00
|
|
|
|
|
|
|
|
2016-11-09 11:29:15 +00:00
|
|
|
router = BulkRouter()
|
|
|
|
router.register(r'v1/users', api.UserViewSet, 'api-user')
|
|
|
|
# router.register(r'v1/user-groups', api.AssetViewSet, 'api-groups')
|
|
|
|
|
|
|
|
|
2016-08-25 05:28:02 +00:00
|
|
|
urlpatterns += [
|
2016-11-09 11:29:15 +00:00
|
|
|
# url(r'^v1/users/$', api.UserListUpdateApi.as_view(), name='user-bulk-update-api'),
|
2016-11-09 15:49:10 +00:00
|
|
|
url(r'^v1/users/token/$', api.UserAuthApi.as_view(), name='api-user-token'),
|
|
|
|
url(r'^v1/users/(?P<pk>\d+)/reset-password/$', api.UserResetPasswordApi.as_view(), name='api-user-reset-password'),
|
|
|
|
url(r'^v1/users/(?P<pk>\d+)/reset-pk/$', api.UserResetPKApi.as_view(), name='api-user-reset-pk'),
|
|
|
|
url(r'^v1/users/(?P<pk>\d+)/update-pk/$', api.UserUpdatePKApi.as_view(), name='api-user-update-pk'),
|
2016-11-09 11:29:15 +00:00
|
|
|
# url(r'^v1/user-groups/$', api.GroupListUpdateApi.as_view(), name='user-group-bulk-update-api'),
|
|
|
|
# url(r'^v1/user-groups/(?P<pk>\d+)/$', api.GroupDetailApi.as_view(), name='user-group-detail-api'),
|
|
|
|
# url(r'^v1/user-groups/(?P<pk>\d+)/user/(?P<uid>\d+)/$',
|
|
|
|
# api.DeleteUserFromGroupApi.as_view(), name='delete-user-from-group-api'),
|
2016-11-09 15:49:10 +00:00
|
|
|
url(r'^v1/users/(?P<pk>\d+)/groups/$',
|
|
|
|
api.UserAndGroupEditApi.as_view(), name='group-user-edit-api'),
|
2016-08-25 05:28:02 +00:00
|
|
|
]
|
2016-11-09 11:29:15 +00:00
|
|
|
|
|
|
|
urlpatterns += router.urls
|