hasAccessForSite
Rights::hasAccessForSite( $siteId, $accessType );
Returns true, when current user has access to site as per specified type.
Parameter
Class | Description | Available from version |
---|---|---|
siteId | Site ID. | |
accessType | Type for which access permissions are checked:
|
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 new site'; } }
© «Bitrix24», 2001-2024