Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
permission.php
1
<?php
2
namespace
Bitrix\Rest\APAuth
;
3
4
use
Bitrix\Main
;
5
use
Bitrix\Rest\Preset\EventController
;
6
32
class
PermissionTable
extends
Main\Entity\DataManager
33
{
34
protected
static
$deniedPermission
= array(
35
'rating'
,
'entity'
,
'placement'
,
'landing_cloud'
, \CRestUtil::GLOBAL_SCOPE
36
);
37
43
public
static
function
getTableName
()
44
{
45
return
'b_rest_ap_permission'
;
46
}
47
53
public
static
function
getMap
()
54
{
55
return
array(
56
'ID'
=> array(
57
'data_type'
=>
'integer'
,
58
'primary'
=>
true
,
59
'autocomplete'
=>
true
,
60
),
61
'PASSWORD_ID'
=> array(
62
'data_type'
=>
'integer'
,
63
'required'
=>
true
,
64
),
65
'PERM'
=> array(
66
'data_type'
=>
'string'
,
67
'required'
=>
true
,
68
),
69
);
70
}
71
72
public
static
function
onPasswordDelete
(Main\
Entity
\
Event
$event)
73
{
74
$data = $event->getParameter(
"id"
);
75
static::deleteByPasswordId($data[
'ID'
]);
76
}
77
78
public
static
function
deleteByPasswordId
($passwordId)
79
{
80
$dbRes = static::getList(
81
array(
82
'filter'
=> array
83
(
84
'=PASSWORD_ID'
=> $passwordId,
85
),
86
'select'
=> array(
'ID'
)
87
)
88
);
89
while
($perm = $dbRes->fetch())
90
{
91
static::delete($perm[
'ID'
]);
92
}
93
}
94
95
public
static
function
cleanPermissionList
(array $permissionList)
96
{
97
foreach
($permissionList as $key => $perm)
98
{
99
if
(in_array($perm, static::$deniedPermission))
100
{
101
unset($permissionList[$key]);
102
}
103
}
104
105
return
array_values($permissionList);
106
}
107
108
public
static
function
onAfterAdd
(Main\
Entity
\
Event
$event)
109
{
110
EventController::onAfterAddApPermission($event);
111
}
112
}
Bitrix\Main\Event
Definition
event.php:5
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Rest\APAuth\PermissionTable
Definition
permission.php:33
Bitrix\Rest\APAuth\PermissionTable\getMap
static getMap()
Definition
permission.php:53
Bitrix\Rest\APAuth\PermissionTable\onPasswordDelete
static onPasswordDelete(Main\Entity\Event $event)
Definition
permission.php:72
Bitrix\Rest\APAuth\PermissionTable\$deniedPermission
static $deniedPermission
Definition
permission.php:34
Bitrix\Rest\APAuth\PermissionTable\cleanPermissionList
static cleanPermissionList(array $permissionList)
Definition
permission.php:95
Bitrix\Rest\APAuth\PermissionTable\deleteByPasswordId
static deleteByPasswordId($passwordId)
Definition
permission.php:78
Bitrix\Rest\APAuth\PermissionTable\onAfterAdd
static onAfterAdd(Main\Entity\Event $event)
Definition
permission.php:108
Bitrix\Rest\APAuth\PermissionTable\getTableName
static getTableName()
Definition
permission.php:43
Bitrix\Rest\Preset\EventController
Definition
eventcontroller.php:15
Bitrix\Main
Bitrix\Rest\APAuth
Definition
application.php:9
modules
rest
lib
apauth
permission.php
Создано системой
1.10.0