string CMain::GetUserRight( string module_id, mixed groups = false, string use_default = "Y", string max_for_admin = "Y" )
The method GetUserRight returns the access permission assigned to a number of groups (group of a current user by default) for the specified module. The permission descriptor returned is meaningful for the specified module.
Generally, each module has specific access permission descriptors. At the same time, there are several common descriptors:
Some modules require that the permissions are assigned individually (e.g. Information blocks) and some does not have access permissions at all (e.g. Compression). The method GetModuleRightList is not applicable to such modules.
Note
For any module, maximum level of permission is always indicated with the symbol W (write), while the minimum permission - with D (deny).
Parameter | Description |
---|---|
module_id | Module ID. |
groups | Array of groups for which the maximum permission is to be determined. Setting this parameter to false assumes the array of groups of the current user. Optional; false by default. |
use_default | If set to "Y", the default access permission level is taken into consideration to determine the maximum permission level Optional; "Y" by default. |
max_for_admin | If set to "Y" and the parameter groups is false, the maximum permission W is always returned for users in the Administrators group (#1) regardless of the module settings. Optional; "Y" by default. |
<? // obtain the maximum access permission // for the WebForms module for the current user if($APPLICATION->GetUserRight("form")<="D") $APPLICATION->AuthForm("access denied."); ?>
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |