Bitrix-D7 23.9
 
Указатель Классы Пространства имен Функции Переменные
Загрузка...
Поиск...
Не найдено
Класс Rights

Открытые статические члены

static setOff ()
 
static setOn ()
 
static setGlobalOff ()
 
static setGlobalOn ()
 
static isOn ()
 
static isAdmin ()
 
static getAllowedSites ()
 
static setContextUserId (int $uid)
 
static clearContextUserId ()
 
static getContextUserId ()
 
static getAccessTasks ()
 
static getAccessTasksReferences ()
 
static removeDataForSite ($siteId)
 
static getDataForSite ($siteId, array $preDefined=[])
 
static getOperationsForSite ($siteId)
 
static hasAccessForSite ($siteId, $accessType, $deleted=false)
 
static hasAccessForLanding ($landingId, $accessType)
 
static setOperationsForSite ($siteId, array $rights=[])
 
static getAccessFilter (array $additionalFilterOr=[])
 
static isExtendedMode ()
 
static switchMode ()
 
static refreshAdditionalRights (array $additionalRights=[])
 
static setAdditionalRightExtended ($code, array $accessCodes=[])
 
static getAdditionalRightExtended ($code)
 
static getAdditionalRightsLabels ()
 
static hasAdditionalRight ($code, $type=null, bool $checkExtraRights=false, bool $strict=false)
 

Открытые атрибуты

const ENTITY_TYPE_SITE = 'S'
 
const ACCESS_TYPES
 
const ADDITIONAL_RIGHTS
 
const SET_PREFIX
 
const REVERSE_RIGHTS
 

Защищенные статические члены

static isFeatureOn ()
 
static removeData ($entityId, $entityType)
 
static getData ($entityId, $entityType, array $preDefined=[])
 
static getOperations ($entityId, $entityType)
 
static setOperations ($entityId, $entityType, array $rights=[])
 
static exist ()
 
static hasExtraRights ()
 

Статические защищенные данные

static $allowedSites = []
 
static $available = true
 
static $globalAvailable = true
 
static $userId = null
 

Подробное описание

См. определение в файле rights.php строка 10

Методы

◆ clearContextUserId()

static clearContextUserId ( )
static

Clears context user id.

Возвращает
void

См. определение в файле rights.php строка 175

◆ exist()

static exist ( )
staticprotected

If any records of rights exists.

Возвращает
bool

См. определение в файле rights.php строка 697

◆ getAccessFilter()

static getAccessFilter ( array $additionalFilterOr = [])
static

Gets access filter for current user.

Аргументы
array$additionalFilterOrAdditional filter for OR section.
Возвращает
array

См. определение в файле rights.php строка 724

◆ getAccessTasks()

static getAccessTasks ( )
static

Gets tasks for access.

Возвращает
array

См. определение в файле rights.php строка 208

◆ getAccessTasksReferences()

static getAccessTasksReferences ( )
static

Gets tasks for access.

Возвращает
array

См. определение в файле rights.php строка 232

◆ getAdditionalRightExtended()

static getAdditionalRightExtended ( $code)
static

Gets additional right.

Аргументы
string$codeCode from ADDITIONAL_RIGHTS.
Возвращает
array

См. определение в файле rights.php строка 910

◆ getAdditionalRightsLabels()

static getAdditionalRightsLabels ( )
static

Gets additional rights with labels.

Возвращает
array

См. определение в файле rights.php строка 957

◆ getAllowedSites()

static getAllowedSites ( )
static

Returns allowed sites with full access.

Возвращает
int[]

См. определение в файле rights.php строка 156

◆ getContextUserId()

static getContextUserId ( )
static

Returns context user id (current by default).

Возвращает
int

См. определение в файле rights.php строка 184

◆ getData()

static getData ( $entityId,
$entityType,
array $preDefined = [] )
staticprotected

Get all rows for entity.

Аргументы
int | array$entityIdEntity id (id or array of id).
string$entityTypeEntity type.
array$preDefinedPredefined array of rights.
Возвращает
array

См. определение в файле rights.php строка 293

◆ getDataForSite()

static getDataForSite ( $siteId,
array $preDefined = [] )
static

Get all rows for site.

Аргументы
int | array$siteIdSite id (id or array of id).
array$preDefinedPredefined array of rights.
Возвращает
array

См. определение в файле rights.php строка 383

◆ getOperations()

static getOperations ( $entityId,
$entityType )
staticprotected

Get all available operations for entity (for current user).

Аргументы
int | array$entityIdEntity id (id or array of id).
string$entityTypeEntity type.
Возвращает
array

См. определение в файле rights.php строка 398

◆ getOperationsForSite()

static getOperationsForSite ( $siteId)
static

Returns all available operations for site (for current user).

Аргументы
int | array$siteIdSite id (id or array of id).
Возвращает
array

См. определение в файле rights.php строка 518

◆ hasAccessForLanding()

static hasAccessForLanding ( $landingId,
$accessType )
static

Can current user do something.

Аргументы
int$landingIdLanding id.
string$accessTypeAccess type code.
Возвращает
boolean

См. определение в файле rights.php строка 578

◆ hasAccessForSite()

static hasAccessForSite ( $siteId,
$accessType,
$deleted = false )
static

Can current user do something.

Аргументы
int$siteIdSite id.
string$accessTypeAccess type code.
bool$deletedAnd from recycle bin.
Возвращает
boolean

См. определение в файле rights.php строка 544

◆ hasAdditionalRight()

static hasAdditionalRight ( $code,
$type = null,
bool $checkExtraRights = false,
bool $strict = false )
static

Has current user additional right or not.

Аргументы
string$codeCode from ADDITIONAL_RIGHTS.
string$typeScope type.
bool$checkExtraRightsCheck extra rights.
Возвращает
bool

См. определение в файле rights.php строка 1025

◆ hasExtraRights()

static hasExtraRights ( )
staticprotected

Has user some extra access?

Возвращает
bool

См. определение в файле rights.php строка 988

◆ isAdmin()

static isAdmin ( )
static

Current user is admin or not.

Возвращает
bool

См. определение в файле rights.php строка 143

◆ isExtendedMode()

static isExtendedMode ( )
static

Extended mode available.

Возвращает
bool

См. определение в файле rights.php строка 781

◆ isFeatureOn()

static isFeatureOn ( )
staticprotected

Available or not permission feature by current plan.

Возвращает
bool

См. определение в файле rights.php строка 197

◆ isOn()

static isOn ( )
static

Check current status for checking rights.

Возвращает
bool

См. определение в файле rights.php строка 123

◆ refreshAdditionalRights()

static refreshAdditionalRights ( array $additionalRights = [])
static

Refresh additional rights for all roles.

Аргументы
array$additionalRightsArray for set additional.
Возвращает
void

См. определение в файле rights.php строка 812

◆ removeData()

static removeData ( $entityId,
$entityType )
staticprotected

Remove all rows for entity.

Аргументы
int | array$entityIdEntity id (id or array of id).
string$entityTypeEntity type.
Возвращает
void

См. определение в файле rights.php строка 253

◆ removeDataForSite()

static removeDataForSite ( $siteId)
static

Remove all rows for site.

Аргументы
int | array$siteIdSite id (id or array of id).
Возвращает
void

См. определение в файле rights.php строка 278

◆ setAdditionalRightExtended()

static setAdditionalRightExtended ( $code,
array $accessCodes = [] )
static

Set additional right.

Аргументы
string$codeCode from ADDITIONAL_RIGHTS.
array$accessCodesAdditional rights array.
Возвращает
void

См. определение в файле rights.php строка 892

◆ setContextUserId()

static setContextUserId ( int $uid)
static

Sets context user id.

Аргументы
int$uid
Возвращает
void

См. определение в файле rights.php строка 166

◆ setGlobalOff()

static setGlobalOff ( )
static

Set rights checking to 'no' (global mode).

Возвращает
void

См. определение в файле rights.php строка 105

◆ setGlobalOn()

static setGlobalOn ( )
static

Set rights checking to 'yes' (global mode).

Возвращает
void

См. определение в файле rights.php строка 114

◆ setOff()

static setOff ( )
static

Set rights checking to 'no'.

Возвращает
void

См. определение в файле rights.php строка 87

◆ setOn()

static setOn ( )
static

Set rights checking to 'yes'.

Возвращает
void

См. определение в файле rights.php строка 96

◆ setOperations()

static setOperations ( $entityId,
$entityType,
array $rights = [] )
staticprotected

Set operations for entity.

Аргументы
int$entityIdEntity id.
string$entityTypeEntity type.
array$rightsRights array (set empty for clear rights).
Возвращает
boolean

См. определение в файле rights.php строка 624

◆ setOperationsForSite()

static setOperationsForSite ( $siteId,
array $rights = [] )
static

Set operations for site.

Аргументы
int$siteIdSite id.
array$rightsRights array (set empty for clear rights).
Возвращает
bool

См. определение в файле rights.php строка 675

◆ switchMode()

static switchMode ( )
static

Switch extended mode.

Возвращает
void

См. определение в файле rights.php строка 797

Данные класса

◆ $allowedSites

$allowedSites = []
staticprotected

См. определение в файле rights.php строка 63

◆ $available

$available = true
staticprotected

См. определение в файле rights.php строка 69

◆ $globalAvailable

$globalAvailable = true
staticprotected

См. определение в файле rights.php строка 75

◆ $userId

$userId = null
staticprotected

См. определение в файле rights.php строка 81

◆ ACCESS_TYPES

const ACCESS_TYPES
Инициализатор
= [
'denied' => 'denied',
'read' => 'read',
'edit' => 'edit',
'sett' => 'sett',
'public' => 'public',
'delete' => 'delete'
]

Access types for different levels.

См. определение в файле rights.php строка 20

◆ ADDITIONAL_RIGHTS

const ADDITIONAL_RIGHTS
Инициализатор
= [
'menu24' => 'menu24',
'admin' => 'admin',
'create' => 'create',
'unexportable' => 'unexportable',
'knowledge_menu24' => 'knowledge_menu24',
'knowledge_admin' => 'knowledge_admin',
'knowledge_create' => 'knowledge_create',
'knowledge_unexportable' => 'knowledge_unexportable',
'knowledge_extension' => 'knowledge_extension',
'group_create' => 'group_create',
'group_admin' => 'group_admin',
'group_menu24' => 'group_menu24',
'group_unexportable' => 'group_unexportable',
]

Additional rights for some functionality.

См. определение в файле rights.php строка 32

◆ ENTITY_TYPE_SITE

const ENTITY_TYPE_SITE = 'S'

Site entity type.

См. определение в файле rights.php строка 15

◆ REVERSE_RIGHTS

const REVERSE_RIGHTS
Инициализатор
= [
'unexportable',
'knowledge_unexportable',
'group_unexportable',
]

См. определение в файле rights.php строка 53

◆ SET_PREFIX

const SET_PREFIX
Инициализатор
= [
'knowledge',
'group',
]

См. определение в файле rights.php строка 48