Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
permission.php
1<?
2namespace Bitrix\Forum;
3
8
35class 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
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}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29