Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Пользовательский контекст: правила маршрутизации пользователей между порталами и агентстким интерфейсом

https://home.simpleone.ru/record/article/158591871514542862

...

Portal contexts


Portal context engine allows restricting access to specified portals for some user categories defined by User Criteria

Example case:

  1. You create two portals: Moscow Users Portal and London Users Portal.
  2. You need to restrict access to these portals only for users from relevant cities.
  3. Using the portal contexts engine, you can easily do this by creating a user criteria record (in this case, you have to specify the location as a criterion).


Tip

Role required: admin.


Note

Before you start, you need to create the necessary user criteria first. For information on how to create them, please refer to the User Criteria article.


To create a portal context, please complete the steps below:

  1. Navigate to Portal Structure → Context Rules → Portal Contexts
  2. Click New and fill in the fields.
  3. Click Save or Save and Exit to apply changes.

Portal context form description

FieldMandatoryDescription
PortalY

Specify a portal to which you need to restrict access.

Note

You can create only one portal context record per one portal.


Active
Select this checkbox to make this portal context record active.
Audience CriteriaNIn this field, select user criteria to define users who will have access to the portal specified. If no criteria were specified, then this portal will be accessible for all users.
OrderN

Specify a portal context record processing order. If some user fits more than one portal context record, then a record with the lesser Order value is applied to him.


Related properties


  1. You can enable or disable this engine by editing the portals.portal_context.enable property value. It is disabled by default. To enable portal context, edit the property value and type 'true'.
  2. You can define roles whose owners disregard portal context rules and have access to all categories and items of the portal specified. For this, edit the
  1. portals.portal_conteхt.override_roles property value and specify roles

...

Функционально обеспечена реализация следующих кейсов:
Кейс для администратора:

1. Создаю новый контекст портала.
2. В форме выбираю портал из списка порталов (еще не имеющих контекста) или агентский интерфейс(также, если контекст для него еще не существует).
3. Контекст портала приобретает имя портала или агентского интерфейса
4. Указываю порядок проверки контекста (целое число)
5. В связанном списке “Аудитория”(Audience или Auditory) выбираю категории пользователей, которым контекст доступен. Категории определяются пользовательскими критериями. Проверка критериев производится через “ИЛИ”.
5. В связанном списке ”Маппинг страниц” (Page Mapping), в новых записях указываю название контроллера агентского интерфейса и соответствующую страницу портала.
6. Для активации контекста устанавливаю флаг “Active”.

Кейсы пользователя, при  активированном механизме проверки портального контекста:

Примеры использования для "агентских" ссылок:  
Пример 1:
1. авторизуюсь через системную страницу логина /login
2. доступен агентский контекст, переходим на главную страницу после авторизации
3. не доступен агентский контекст, но найден первый доступный портальный контекст, переходим на главную страницу данного портала
4. нет ни одного доступного контекста, переходим на 403
Пример 2:
1. перехожу по ссылке в агентском интерфейсе, например /form/change_request/XXXXXXXXXXXXXXXXX
2. доступен агентский контекст, переходим на страницу в агентском интерфейсе после авторизации
3. не доступен агентский контекст, но найден первый доступный портальный контекст, 
4. ищем соответствующую контролеру страницу в маппинге страниц
5. нашли, переходим на эту страницу портала, с передачей параметров в URL.
6. не нашли открываем портальную 404
7. нет ни одного доступного контекста, переходим на 403

Примеры использования для "портальных" ссылок: 
1. авторизуюсь через портальную страницу логина /portal_suffix/login
2. проверяем доступен ли пользователю контекст для portal_suffix
 - да, переходим на главную страницу портала portal_suffix
 - не доступен  контекст для portal_suffix ищем другие контексты
3. производим поиск других доступных контекстов, 
 - нашли, переходим на эту страницу портала, с передачей параметров в URL
 - не нашли, нет ни одного доступного контекста, переходим на 403
4. перехожу по портальной ссылке /portal_suffix/announce?XXXXXXXXXXXX
5. проверяем доступен ли пользователю контекст для portal_suffix
 - да, переходим на страницу портала/portal_suffix/announce 
 - не доступен  контекст для portal_suffix ищем другие контексты
6. производим поиск других доступных контекстов, 
 - нашли, переходим на указанную страницу портала, если в карте портала есть такая страница, с передачей параметров в URL, иначе 404 страница найденного портала 
 - не нашли, нет ни одного доступного контекста, переходим на 403

...

  1. here.
Note

The admin role is already preconfigured for portal context overriding.

Page mappings


The page mappings engine is used to configure redirect rules in case if the visited link is not accessible for the user due to role restrictions.

Example case:

  1. One user sent a task link to another. The task link leads to the administrative interface and looks like this: (https://instance.example.com/record/task/16850930533524).
  2. The other user does not have an agent role, so he will not be able to open it correctly. But he can open portal links, respectively.
  3. The page mappings engine allows creating a rule which will convert administrative interface links to portal links.
  4. After processing with a rule, the initial link looks like this:
    1. https://instance.example.com/portal/record/?table_name=task&record_id=16850930533524&view=SP
  5. Now, the link recipient can see the link content.


Tip

Role required: admin.

To create a page mapping rule from scratch, please complete the steps below:

  1. Navigate to Portal Structure → Context Rules → Page Mappings.
  2. Click New and fill in the fields.
  3. Click Save or Save and Exit to apply changes.
Tip

It is more effective to create page mapping rules out of the portal context rules. For this, navigate to the relevant portal context record, open the 


FieldMandatoryDescription
Portal ContextYSpecify a reference to the previously created portal context.
URL TemplateY

Specify initial URL template. You can use variables here.

Examples:

record/task/{id}

{controller}/{essence}/{id}

Portal PageY

Specify portal page URL template. This template is used to create URLs for portal pages out of URLs passed.

Example:

/portal/record/?table_name=task&record_id={id}&view=SP


Table of Contents
absoluteUrltrue
classfixedPosition
printablefalse

есть свойство portals.portal_context.enable, По-умолчанию значение false. Принимает true/false., Свойство создано и используется для включения и отключения механизма

...