K4:Ограничение доступа к шаблону
From In-Portal Developers Guide
| ||
---|---|---|
Статьи в этой категории | ||
|
Для ограничения доступа к шаблону используются тэги m_CheckPermission и m_RequireLogin.
m_CheckPermission
This tag is used to check permissions to access information on the template. In case if we need to limit the access to the entire template then m_RequireLogin tag should be used instead.
Below is a list of accepted parameters:
Parameter | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
perm_event (string) | Event Name for which permissions will be checked. Event Name should be specified in the following format "prefix_special:EventName ", example "u:OnCreate ".
| ||||||||||
perm_prefix (string) | Prefix of the object which Primary Section will be used to check the permissions. For example, Link (prefix "l") or Product (prefix "p") is located inside particular section. Note that Section used to be called Category before In-Portal v5.0.0. | ||||||||||
permissions (string) | Permission(s) Name that will be checked. For better results Permissions can be grouped together:
To list multiple permissions as one group use comma ("
| ||||||||||
system (bool) | Indicates that we check System Permissions - NOT dependent or related to the current Section. Note that Section used to be called Category before In-Portal v5.0.0. |
m_RequireLogin
Данный тэг используется для создания шаблонов доступных к просмотру только пользователям, прошедшим идентификацию (logged in). Его также можно использовать для проверки прав доступа, принадлежности к группе и тому подобных вещей. Широкий спектр параметров делает его незаменимым в CMS системах.
Current tag is mainly used to check whether use is Logged In or not. It also can be used to check if user belongs to any specific User Group. Tag accepts wide range of parameters and can be successfully used in other tasks.
Parameter | Description | ||
---|---|---|---|
no_permissions_template (string) | Template Name where user will be redirected if NO rights to access returned. In case if this parameter is not specified as well as login_template, then the following template will be used:
| ||
condition (string) | Name of Configuration Variable, which value will be checked. Exclamation mark ("! ") can be put before the Variable name to use NOT logic, examples:
| ||
group (string) | Name of User Group current user should belong to. | ||
pass_category (bool) | Whether to pass through or not the current Section when Permissions check fails (returned FALSE) and user will be redirected to "no permissions" template. | ||
no_group_perm_template (string) | In case if user successfully passed Logged In check, however does NOT belong to a specified User Group, then redirect user to specified in this parameter template. | ||
login_template (string) | In case if user did NOT pass Logged In check, then redirect user to specified in this parameter template. Specified template will be also used if any of below listed parameters are left empty: |