Merge branch 'feature/documentation' into 'develop'

Feature/documentation

See merge request 2020-2021/online/s101/group-02/access_controller!49
This commit is contained in:
Кравченко Артем 2021-04-13 12:00:08 +00:00
commit 0ef60f0e65
16 changed files with 31 additions and 12 deletions

View File

@ -1,7 +1,7 @@
[
{
"model": "auth.user",
"pk": 1,
"pk": 3,
"fields": {
"password": "pbkdf2_sha256$216000$gHBBCr1jBELf$ZkEDW3IEd8Wij7u8vkv+0Eze32CS01bcaYWhcD9OIC4=",
"last_login": null,
@ -19,16 +19,16 @@
},
{
"model": "main.userprofile",
"pk": 1,
"pk": 3,
"fields": {
"name": "ZendeskAdmin",
"user": 1,
"user": 3,
"role": "admin"
}
},
{
"model": "auth.user",
"pk": 2,
"pk": 4,
"fields": {
"password": "pbkdf2_sha256$216000$5qLJgrm2Quq9$KDBNNymVZXkUx0HKBPFst2m83kLe0egPBnkW7KnkORU=",
"last_login": null,
@ -46,10 +46,10 @@
},
{
"model": "main.userprofile",
"pk": 2,
"pk": 4,
"fields": {
"name": "UserForAccessTest",
"user": 2,
"user": 4,
"role": "agent",
"custom_role_id": "360005209000"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -3,7 +3,7 @@
=========================
******************************
**Управление правами доступа**
Управление правами доступа
******************************
@ -22,7 +22,7 @@
* **"Войти"** - если Вы уже являетесь зарегистрированным пользователем
* **"Зарегистрироваться"** - при первом входе
.. image:: _static/main.png
.. image:: _static/main_logout.png
Внимание! Для регистрации используется email с сайта Zendesk. Регистрация по каждому email
возможна один раз
@ -32,7 +32,7 @@
* **"Профиль"** - просмотреть свои данные и запросить права доступа
* **"Запрос прав"** - получение прав для работы с тикетами или **"Управление"** - доступно для администратора и предоставляет возможность группового назначения ролей пользователям
.. image:: _static/main_logined_agent.png
.. image:: _static/main.png
*************
Регистрация
@ -72,7 +72,11 @@
На странице запроса прав Вам доступна информация о количестве и списке работающих над тикетами сотрудников,
а также возможность сдать и запросить права.
.. image:: _static/permission_request.png
.. image:: _static/request.png
Успешное изменение прав:
.. image:: _static/role_change.png
******************************************
Управление правами доступа администратором
@ -84,6 +88,10 @@
* Количество и список инженеров и легких агентов
* Возможность группового назначения прав с использованием чек-боксов
.. image:: _static/permission_management.png
.. image:: _static/admin_manage.png
Изменение прав пользователей наглядно отразится в таблице пользователей:
.. image:: _static/admin_manage_done.png
.. |copy| unicode:: 0xA9 .. Школа программистов S101, группа 2. 2021гю

View File

@ -80,6 +80,8 @@ API
functions
Serializer
Serializers
Сериализатор
переадресации

View File

@ -232,7 +232,10 @@ def work_become_engineer(request: WSGIRequest) -> HttpResponseRedirect:
return HttpResponseRedirect(reverse('work', args=(request.user.id,)))
def main_page(request):
def main_page(request: WSGIRequest) -> HttpResponse:
"""
Функция переадресации на главную страницу.
"""
return render(request, 'pages/index.html')
@ -281,6 +284,12 @@ class AdminPageView(LoginRequiredMixin, PermissionRequiredMixin,SuccessMessageMi
log(user, self.request.user.userprofile)
def make_light_agents(self, users):
"""
Функция проходит по списку пользователей, проставляя статус "light agent".
:param users: Список пользователей
:return: Обновленный список пользователей
"""
for user in users:
make_light_agent(user, self.request.user)
log(user, self.request.user.userprofile)