Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
permission.php
1
<?
2
namespace
Bitrix\Forum
;
3
4
use
Bitrix\Main\Entity
;
5
use
Bitrix\Main\Localization\Loc
;
6
use
Bitrix\Main\ORM\Fields\Relations\Reference
;
7
use
Bitrix\Main\ORM\Query\Join
;
8
35
class
PermissionTable
extends
Entity\DataManager
36
{
42
public
static
function
getTableName
()
43
{
44
return
'b_forum_perms'
;
45
}
46
52
public
static
function
getMap
()
53
{
54
return
[
55
new
Entity\IntegerField(
'ID'
, [
'primary'
=>
true
,
'autocomplete'
=>
true
]),
56
new
Entity\IntegerField(
'FORUM_ID'
),
57
new
Entity\IntegerField(
'GROUP_ID'
),
58
new
Entity\StringField(
'PERMISSION'
, [
'size'
=> 1]),
59
new
Reference
(
"GROUP"
, \
Bitrix
\Main\GroupTable::class, Join::on(
"this.ID"
,
"ref.GROUP_ID"
))
60
];
61
}
62
}
63
64
65
// A < E < I < M < Q < U < Y
66
class
Permission
{
67
public
const
ACCESS_DENIED
=
"A"
;
68
public
const
CAN_READ
=
"E"
;
69
public
const
CAN_ADD_MESSAGE
=
"I"
;
70
public
const
CAN_ADD_TOPIC
=
"M"
;
71
public
const
CAN_MODERATE
=
"Q"
;
72
public
const
CAN_EDIT
=
"U"
;
73
public
const
FULL_ACCESS
=
"Y"
;
74
79
public
static
function
getList
()
80
{
81
$res = (new \ReflectionClass(__CLASS__))->getConstants();
82
$result = array();
83
foreach
($res as $code => $id)
84
{
85
$result[$id] = $code;
86
}
87
return
$result;
88
}
93
public
static
function
getTitledList
()
94
{
95
$res = (new \ReflectionClass(__CLASS__))->getConstants();
96
$result = array();
97
foreach
($res as $code => $id)
98
{
99
$result[$id] =
Loc::getMessage
(
"FORUM_PERMISSION_"
.$code);
100
}
101
return
$result;
102
}
103
}
Bitrix\Forum\Permission
Definition
permission.php:66
Bitrix\Forum\Permission\CAN_EDIT
const CAN_EDIT
Definition
permission.php:72
Bitrix\Forum\Permission\CAN_ADD_TOPIC
const CAN_ADD_TOPIC
Definition
permission.php:70
Bitrix\Forum\Permission\FULL_ACCESS
const FULL_ACCESS
Definition
permission.php:73
Bitrix\Forum\Permission\ACCESS_DENIED
const ACCESS_DENIED
Definition
permission.php:67
Bitrix\Forum\Permission\CAN_READ
const CAN_READ
Definition
permission.php:68
Bitrix\Forum\Permission\getTitledList
static getTitledList()
Definition
permission.php:93
Bitrix\Forum\Permission\CAN_ADD_MESSAGE
const CAN_ADD_MESSAGE
Definition
permission.php:69
Bitrix\Forum\Permission\CAN_MODERATE
const CAN_MODERATE
Definition
permission.php:71
Bitrix\Forum\Permission\getList
static getList()
Definition
permission.php:79
Bitrix\Forum\PermissionTable
Definition
permission.php:36
Bitrix\Forum\PermissionTable\getMap
static getMap()
Definition
permission.php:52
Bitrix\Forum\PermissionTable\getTableName
static getTableName()
Definition
permission.php:42
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Main\ORM\Fields\Relations\Reference
Definition
reference.php:26
Bitrix\Main\ORM\Query\Join
Definition
join.php:19
Bitrix\Forum
Bitrix
modules
forum
lib
permission.php
Создано системой
1.10.0