hasAccessForSite
Rights::hasAccessForSite( $siteId, $accessType );
Returns true, when current user has access to site at the specified type.
Parameters
Parameter | Description | Available from version |
---|---|---|
siteId | Site identifier./td> | |
accessType | Type with enabled access permissions check:
|
Example
if (\Bitrix\Main\Loader::includeModule('landing')) { if (\Bitrix\Landing\Rights::hasAccessForSite($siteId, 'delete')) { echo 'You can delete this site'; } }
Access permission check for creating a new site:
if (\Bitrix\Main\Loader::includeModule('landing')) { if (\Bitrix\Landing\Rights::hasAccessForSite(0, 'sett')) { echo 'You can create a new site'; } }
© «Bitrix24», 2001-2024