Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
rights.php
1<?php
2namespace Bitrix\Landing;
3
4use \Bitrix\Landing\Internals\RightsTable;
5use \Bitrix\Main\Localization\Loc;
6use \Bitrix\Main\UserAccessTable;
7
8Loc::loadMessages(__FILE__);
9
10class Rights
11{
15 const ENTITY_TYPE_SITE = 'S';
16
20 const ACCESS_TYPES = [
21 'denied' => 'denied',
22 'read' => 'read',
23 'edit' => 'edit',
24 'sett' => 'sett',
25 'public' => 'public',
26 'delete' => 'delete'
27 ];
28
33 'menu24' => 'menu24',//show in main menu of Bitrix24
34 'admin' => 'admin',//admin rights
35 'create' => 'create',//can create new sites
36 'unexportable' => 'unexportable',
37 'knowledge_menu24' => 'knowledge_menu24',// show Knowledge in main menu of Bitrix24
38 'knowledge_admin' => 'knowledge_admin',//admin rights
39 'knowledge_create' => 'knowledge_create',//can create new Knowledge base
40 'knowledge_unexportable' => 'knowledge_unexportable',
41 'knowledge_extension' => 'knowledge_extension',
42 'group_create' => 'group_create',//can create new social network group base
43 'group_admin' => 'group_admin',//admin rights
44 'group_menu24' => 'group_menu24',// show group in main menu of Bitrix24
45 'group_unexportable' => 'group_unexportable',
46 ];
47
48 const SET_PREFIX = [
49 'knowledge',
50 'group',
51 ];
52
54 'unexportable',
55 'knowledge_unexportable',
56 'group_unexportable',
57 ];
58
63 protected static $allowedSites = [];
64
69 protected static $available = true;
70
75 protected static $globalAvailable = true;
76
81 protected static $userId = null;
82
87 public static function setOff()
88 {
89 self::$available = false;
90 }
91
96 public static function setOn()
97 {
98 self::$available = true;
99 }
100
105 public static function setGlobalOff()
106 {
107 self::$globalAvailable = false;
108 }
109
114 public static function setGlobalOn()
115 {
116 self::$globalAvailable = true;
117 }
118
123 public static function isOn()
124 {
125 if (
126 defined('LANDING_DISABLE_RIGHTS') &&
127 LANDING_DISABLE_RIGHTS === true
128 )
129 {
130 return false;
131 }
132 if (!self::$globalAvailable)
133 {
134 return false;
135 }
136 return self::$available;
137 }
138
143 public static function isAdmin()
144 {
145 if (self::hasAdditionalRight(self::ADDITIONAL_RIGHTS['admin'], null, false, true))
146 {
147 return true;
148 }
149 return Manager::isAdmin();
150 }
151
156 public static function getAllowedSites(): array
157 {
158 return self::$allowedSites;
159 }
160
166 public static function setContextUserId(int $uid): void
167 {
168 self::$userId = $uid;
169 }
170
175 public static function clearContextUserId(): void
176 {
177 self::$userId = null;
178 }
179
184 public static function getContextUserId(): int
185 {
186 if (!self::$userId)
187 {
188 self::$userId = Manager::getUserId();
189 }
190 return self::$userId;
191 }
192
197 protected static function isFeatureOn()
198 {
201 );
202 }
203
208 public static function getAccessTasks()
209 {
210 static $tasks = [];
211
212 if (empty($tasks))
213 {
214 $res = \CTask::getList(
215 ['LETTER' => 'ASC'],
216 ['MODULE_ID' => 'landing']
217 );
218 while ($row = $res->fetch())
219 {
220 $row['NAME'] = mb_substr($row['NAME'], 14);
221 $tasks[$row['ID']] = $row;
222 }
223 }
224
225 return $tasks;
226 }
227
232 public static function getAccessTasksReferences()
233 {
234 static $tasks = [];
235
236 if (empty($tasks))
237 {
238 foreach (self::getAccessTasks() as $accessTask)
239 {
240 $tasks[$accessTask['NAME']] = $accessTask['ID'];
241 }
242 }
243
244 return $tasks;
245 }
246
253 protected static function removeData($entityId, $entityType)
254 {
255 if (self::isFeatureOn())
256 {
257 $res = RightsTable::getList([
258 'select' => [
259 'ID'
260 ],
261 'filter' => [
262 'ENTITY_ID' => $entityId,
263 '=ENTITY_TYPE' => $entityType
264 ]
265 ]);
266 while ($row = $res->fetch())
267 {
268 RightsTable::delete($row['ID']);
269 }
270 }
271 }
272
278 public static function removeDataForSite($siteId)
279 {
280 self::removeData(
281 $siteId,
282 self::ENTITY_TYPE_SITE
283 );
284 }
285
293 protected static function getData($entityId, $entityType, array $preDefined = [])
294 {
295 static $access = null;
296 $items = [];
297 $codes = [];
298
299 if ($access === null)
300 {
301 $access = new \CAccess;
302 }
303
304 // filter (with predefined_
305 $filter = [
306 'ENTITY_ID' => $entityId,
307 '=ENTITY_TYPE' => $entityType
308 ];
309 if ($preDefined)
310 {
311 $filter['=ACCESS_CODE'] = array_keys($preDefined);
312 }
313
314 // main query
315 $res = RightsTable::getList([
316 'select' => [
317 'TASK_ID',
318 'ACCESS_CODE'
319 ],
320 'filter' => $filter
321 ]);
322 while ($row = $res->fetch())
323 {
324 $codes[] = $row['ACCESS_CODE'];
325 if (!isset($items[$row['ACCESS_CODE']]))
326 {
327 $row['TASK_ID'] = [$row['TASK_ID']];
328 $items[$row['ACCESS_CODE']] = $row;
329 }
330 else
331 {
332 $items[$row['ACCESS_CODE']]['TASK_ID'][] = $row['TASK_ID'];
333 }
334 if (isset($preDefined[$row['ACCESS_CODE']]))
335 {
336 unset($preDefined[$row['ACCESS_CODE']]);
337 }
338 }
339
340 $items = array_values($items);
341
342 // fill with predefined
343 foreach ($preDefined as $accessCode => $rightCode)
344 {
345 $items[] = [
346 'TASK_ID' => $rightCode,
347 'ACCESS_CODE' => $accessCode
348 ];
349 $codes[] = $accessCode;
350 }
351
352 // get titles
353 if ($items)
354 {
355 $codesNames = $access->getNames($codes);
356 foreach ($items as &$item)
357 {
358 if (isset($codesNames[$item['ACCESS_CODE']]))
359 {
360 $item['ACCESS_PROVIDER'] = (
361 isset($codesNames[$item['ACCESS_CODE']]['provider']) &&
362 $codesNames[$item['ACCESS_CODE']]['provider']
363 )
364 ? $codesNames[$item['ACCESS_CODE']]['provider']
365 : '';
366 $item['ACCESS_NAME'] = isset($codesNames[$item['ACCESS_CODE']]['name'])
367 ? $codesNames[$item['ACCESS_CODE']]['name']
368 : $item['ACCESS_CODE'];
369 }
370 }
371 unset($item);
372 }
373
374 return $items;
375 }
376
383 public static function getDataForSite($siteId, array $preDefined = [])
384 {
385 return self::getData(
386 $siteId,
387 self::ENTITY_TYPE_SITE,
388 $preDefined
389 );
390 }
391
398 protected static function getOperations($entityId, $entityType)
399 {
400 // full access for allowed sites
401 if (
402 $entityType == self::ENTITY_TYPE_SITE &&
403 in_array($entityId, self::$allowedSites)
404 )
405 {
406 $types = self::ACCESS_TYPES;
407 unset($types[self::ACCESS_TYPES['delete']]);
408 return array_values($types);
409 }
410
411 // check scoped method
412 if (
413 $entityType == self::ENTITY_TYPE_SITE
414 && !is_array($entityId) && $entityId > 0
415 )
416 {
417 $scopeOperationsSite = Site\Type::getOperationsForSite($entityId);
418 if ($scopeOperationsSite !== null)
419 {
420 return array_values($scopeOperationsSite);
421 }
422 }
423
424 $operations = [];
425 $operationsDefault = [];
426 $wasChecked = false;
427 $uid = self::getContextUserId();
428 $extendedMode = self::isExtendedMode();
429
430 // full access for admin
431 if (
432 $uid &&
433 self::isOn() &&
434 !self::isAdmin() &&
435 self::isFeatureOn() &&
436 self::exist()
437 )
438 {
439 $wasChecked = true;
440 $entityIdFilter = $entityId;
441 if (is_array($entityIdFilter))
442 {
443 $entityIdFilter[] = 0;
444 }
445 else
446 {
447 $entityIdFilter = [
448 $entityIdFilter, 0
449 ];
450 }
451 $filter = [
452 'ENTITY_ID' => $entityIdFilter,
453 '=ENTITY_TYPE' => $entityType,
454 'USER_ACCESS.USER_ID' => $uid,
455 '!TASK_OPERATION.OPERATION.NAME' => false
456 ];
457 if ($extendedMode)
458 {
459 $filter['ROLE_ID'] = 0;
460 }
461 else
462 {
463 $filter['ROLE_ID'] = Role::getExpectedRoleIds();
464 }
465 $res = RightsTable::getList(
466 [
467 'select' => [
468 'ENTITY_ID',
469 'OPERATION_NAME' => 'TASK_OPERATION.OPERATION.NAME'
470 ],
471 'filter' => $filter
472 ]
473 );
474 while ($row = $res->fetch())
475 {
476 if ($row['ENTITY_ID'] == 0)
477 {
478 $operationsDefault[] = mb_substr($row['OPERATION_NAME'], 8);
479 continue;
480 }
481 if (!isset($operations[$row['ENTITY_ID']]))
482 {
483 $operations[$row['ENTITY_ID']] = array();
484 }
485 $operations[$row['ENTITY_ID']][] = mb_substr($row['OPERATION_NAME'], 8);
486 $operations[$row['ENTITY_ID']] = array_unique($operations[$row['ENTITY_ID']]);
487 }
488 }
489
490 // set full rights, if rights are empty
491 foreach ((array) $entityId as $id)
492 {
493 if (!isset($operations[$id]))
494 {
495 if ($wasChecked && !$extendedMode)
496 {
497 $operations[$id] = !empty($operationsDefault)
498 ? $operationsDefault
499 : [self::ACCESS_TYPES['denied']];
500 }
501 else
502 {
503 $operations[$id] = array_values(self::ACCESS_TYPES);
504 }
505 }
506 }
507
508 return is_array($entityId)
509 ? $operations
510 : $operations[$entityId];
511 }
512
518 public static function getOperationsForSite($siteId): array
519 {
520 if (
521 is_array($siteId) ||
522 $siteId == 0 ||
523 Site::ping($siteId, true)
524 )
525 {
526 return self::getOperations(
527 $siteId,
528 self::ENTITY_TYPE_SITE
529 );
530 }
531 else
532 {
533 return [];
534 }
535 }
536
544 public static function hasAccessForSite($siteId, $accessType, $deleted = false)
545 {
546 static $operations = [];
547 $siteId = intval($siteId);
548
549 if (!is_string($accessType))
550 {
551 return false;
552 }
553
554 if (!isset($operations[$siteId]))
555 {
556 if ($siteId === 0 || !self::isOn() || Site::ping($siteId, $deleted))
557 {
558 $operations[$siteId] = self::getOperations(
559 $siteId,
560 self::ENTITY_TYPE_SITE
561 );
562 }
563 else
564 {
565 $operations[$siteId] = [];
566 }
567 }
568
569 return in_array($accessType, $operations[$siteId]);
570 }
571
578 public static function hasAccessForLanding($landingId, $accessType)
579 {
580 static $operations = [];
581 $landingId = intval($landingId);
582
583 if (!is_string($accessType))
584 {
585 return false;
586 }
587
588 if (!isset($operations[$landingId]))
589 {
590 $site = Landing::getList([
591 'select' => [
592 'SITE_ID'
593 ],
594 'filter' => [
595 'ID' => $landingId,
596 '=SITE.DELETED' => ['Y', 'N'],
597 '=DELETED' => ['Y', 'N']
598 ]
599 ])->fetch();
600
601 if ($site)
602 {
603 $operations[$landingId] = self::getOperations(
604 $site['SITE_ID'],
605 self::ENTITY_TYPE_SITE
606 );
607 }
608 else
609 {
610 $operations[$landingId] = [];
611 }
612 }
613
614 return in_array($accessType, $operations[$landingId]);
615 }
616
624 protected static function setOperations($entityId, $entityType, array $rights = [])
625 {
626 if (!self::isFeatureOn())
627 {
628 return false;
629 }
630
631 $tasks = self::getAccessTasksReferences();
632 $entityId = intval($entityId);
633
634 self::removeData(
635 $entityId,
636 $entityType
637 );
638
639 // add new rights
640 foreach ($rights as $accessCode => $rightCodes)
641 {
642 $rightCodes = (array) $rightCodes;
643 if (in_array(self::ACCESS_TYPES['denied'], $rightCodes))
644 {
645 $rightCodes = [self::ACCESS_TYPES['denied']];
646 }
647 else if (!in_array(self::ACCESS_TYPES['read'], $rightCodes))
648 {
649 $rightCodes[] = self::ACCESS_TYPES['read'];
650 }
651
652 foreach ($rightCodes as $rightCode)
653 {
654 if (isset($tasks[$rightCode]))
655 {
656 RightsTable::add([
657 'ENTITY_ID' => $entityId,
658 'ENTITY_TYPE' => $entityType,
659 'TASK_ID' => $tasks[$rightCode],
660 'ACCESS_CODE' => $accessCode
661 ]);
662 }
663 }
664 }
665
666 return true;
667 }
668
675 public static function setOperationsForSite($siteId, array $rights = [])
676 {
677 $siteId = intval($siteId);
678
679 if ($siteId == 0 || Site::ping($siteId))
680 {
681 return self::setOperations(
682 $siteId,
683 self::ENTITY_TYPE_SITE,
684 $rights
685 );
686 }
687 else
688 {
689 return false;
690 }
691 }
692
697 protected static function exist()
698 {
699 static $exist = null;
700
701 if ($exist === null)
702 {
703 $type = Site\Type::getCurrentScopeId();
704 $res = RightsTable::getList([
705 'select' => [
706 'ID'
707 ],
708 'filter' => $type
709 ? ['=ROLE.TYPE' => $type]
710 : [],
711 'limit' => 1
712 ]);
713 $exist = (bool) $res->fetch();
714 }
715
716 return $exist;
717 }
718
724 public static function getAccessFilter(array $additionalFilterOr = [])
725 {
726 $filter = [];
727
728 if (
729 self::isOn() &&
730 !self::isAdmin() &&
731 self::isFeatureOn() &&
732 self::exist()
733 )
734 {
735 $tasks = self::getAccessTasksReferences();
736 $extendedRights = self::isExtendedMode();
737 $uid = self::getContextUserId();
738
739 if ($extendedRights)
740 {
741 $filter[] = [
742 'LOGIC' => 'OR',
743 [
744 '!RIGHTS.TASK_ID' => $tasks[Rights::ACCESS_TYPES['denied']],
745 'RIGHTS.USER_ACCESS.USER_ID' => $uid
746 ],
747 [
748 '=RIGHTS.TASK_ID' => null
749 ],
750 $additionalFilterOr
751 ];
752 }
753 else
754 {
755 if ($additionalFilterOr)
756 {
757 $filter[] = [
758 'LOGIC' => 'OR',
759 [
760 '!RIGHTS.TASK_ID' => $tasks[Rights::ACCESS_TYPES['denied']],
761 'RIGHTS.USER_ACCESS.USER_ID' => $uid
762 ],
763 $additionalFilterOr
764 ];
765 }
766 else
767 {
768 $filter['RIGHTS.USER_ACCESS.USER_ID'] = $uid;
769 $filter['!RIGHTS.TASK_ID'] = $tasks[Rights::ACCESS_TYPES['denied']];
770 }
771 }
772 }
773
774 return $filter;
775 }
776
781 public static function isExtendedMode()
782 {
783 if (Manager::isB24())
784 {
785 return Manager::getOption('rights_extended_mode', 'N') == 'Y';
786 }
787 else
788 {
789 return true;
790 }
791 }
792
797 public static function switchMode()
798 {
799 if (self::isFeatureOn())
800 {
801 $current = Manager::getOption('rights_extended_mode', 'N');
802 $current = ($current == 'Y') ? 'N' : 'Y';
803 Manager::setOption('rights_extended_mode', $current);
804 }
805 }
806
812 public static function refreshAdditionalRights(array $additionalRights = [])
813 {
814 if (!self::isFeatureOn())
815 {
816 return;
817 }
818
819 $rights = [];
820 foreach (self::ADDITIONAL_RIGHTS as $right)
821 {
822 $rights[$right] = [];
823 }
824
825 // get additional from all roles
826 $res = Role::getList([
827 'select' => [
828 'ID', 'ACCESS_CODES', 'ADDITIONAL_RIGHTS'
829 ]
830 ]);
831 while ($row = $res->fetch())
832 {
833 $row['ACCESS_CODES'] = (array) $row['ACCESS_CODES'];
834 $row['ADDITIONAL_RIGHTS'] = (array) $row['ADDITIONAL_RIGHTS'];
835 foreach ($row['ADDITIONAL_RIGHTS'] as $right)
836 {
837 if (isset($rights[$right]))
838 {
839 $rights[$right][$row['ID']] = $row['ACCESS_CODES'];
840 }
841 }
842 }
843
844 // refresh options
845 foreach ($rights as $code => $right)
846 {
847 // gets current from option
848 $option = Manager::getOption('access_codes_' . $code, '');
849 $option = unserialize($option, ['allowed_classes' => false]);
850 if (isset($option[0]))
851 {
852 $right[0] = $option[0];
853 }
854
855 // rewrite some rights, if need
856 if (
857 isset($additionalRights[$code]) &&
858 is_array($additionalRights[$code])
859 )
860 {
861 foreach ($additionalRights[$code] as $i => $accCodes)
862 {
863 $right[$i] = (array) $accCodes;
864 }
865 }
866
867 // set new rights in option
868 Manager::setOption('access_codes_' . $code, $right ? serialize($right) : '');
869
870 // clear menu cache
871 if (Manager::isB24())
872 {
873 Manager::getCacheManager()->clearByTag(
874 'bitrix24_left_menu'
875 );
876 Manager::getCacheManager()->cleanDir(
877 'menu'
878 );
879 \CBitrixComponent::clearComponentCache(
880 'bitrix:menu'
881 );
882 }
883 }
884 }
885
892 public static function setAdditionalRightExtended($code, array $accessCodes = [])
893 {
894 if (!is_string($code))
895 {
896 return;
897 }
898 self::refreshAdditionalRights([
899 $code => [
900 0 => $accessCodes
901 ]
902 ]);
903 }
904
910 public static function getAdditionalRightExtended($code)
911 {
912 static $access = null;
913 $return = [];
914
915 if (!is_string($code))
916 {
917 return $return;
918 }
919 if ($access === null)
920 {
921 $access = new \CAccess;
922 }
923
924 $option = Manager::getOption('access_codes_' . $code, '');
925 $option = unserialize($option, ['allowed_classes' => false]);
926 $accessCodes = isset($option[0]) ? (array)$option[0] : [];
927 $codesNames = $access->getNames($accessCodes);
928
929 foreach ($accessCodes as $code)
930 {
931 if (isset($codesNames[$code]))
932 {
933 $provider = (
934 isset($codesNames[$code]['provider']) &&
935 $codesNames[$code]['provider']
936 )
937 ? $codesNames[$code]['provider']
938 : '';
939 $name = isset($codesNames[$code]['name'])
940 ? $codesNames[$code]['name']
941 : $code;
942 $return[$code] = [
943 'CODE' => $code,
944 'PROVIDER' => $provider,
945 'NAME' => $name
946 ];
947 }
948 }
949
950 return $return;
951 }
952
957 public static function getAdditionalRightsLabels()
958 {
959 $rights = [];
960
961 $type = Site\Type::getCurrentScopeId();
962
963 foreach (self::ADDITIONAL_RIGHTS as $right)
964 {
965 if (mb_strpos($right, '_') > 0)
966 {
967 [$prefix, ] = explode('_', $right);
968 $prefix = mb_strtoupper($prefix);
969 if ($prefix != $type)
970 {
971 continue;
972 }
973 }
974 else if ($type !== null)
975 {
976 continue;
977 }
978 $rights[$right] = Loc::getMessage('LANDING_RIGHTS_R_'.mb_strtoupper($right));
979 }
980
981 return $rights;
982 }
983
988 protected static function hasExtraRights(): bool
989 {
990 // has context user access to crm forms
991 if (\Bitrix\Main\Loader::includeModule('crm'))
992 {
993 $access = new \CCrmPerms(self::getContextUserId());
994 if (!$access->havePerm('WEBFORM', BX_CRM_PERM_NONE, 'WRITE'))
995 {
996 // grant access to crm forms sites
997 $res = Site::getList([
998 'select' => [
999 'ID'
1000 ],
1001 'filter' => [
1002 'CODE' => '/' . Site\Type::PSEUDO_SCOPE_CODE_FORMS . '%',
1003 '=SPECIAL' => 'Y',
1004 'CHECK_PERMISSIONS' => 'N'
1005 ]
1006 ]);
1007 while ($row = $res->fetch())
1008 {
1009 self::$allowedSites[] = $row['ID'];
1010 }
1011
1012 return true;
1013 }
1014 }
1015 return false;
1016 }
1017
1025 public static function hasAdditionalRight($code, $type = null, bool $checkExtraRights = false, bool $strict = false)
1026 {
1027 static $options = [];
1028
1029 if ($checkExtraRights && self::hasExtraRights())
1030 {
1031 return true;
1032 }
1033
1034 if (!is_string($code))
1035 {
1036 return false;
1037 }
1038 if ($type === null)
1039 {
1040 $type = Site\Type::getCurrentScopeId();
1041 }
1042
1043 if ($type !== null)
1044 {
1045 $type = mb_strtolower($type);
1046 //@todo: hotfix for group right
1047 if ($type == Site\Type::SCOPE_CODE_GROUP)
1048 {
1049 return true;
1050 }
1051 $code = $type . '_' . $code;
1052 }
1053
1054 if (array_key_exists($code, self::ADDITIONAL_RIGHTS))
1055 {
1056 if (!self::isFeatureOn())
1057 {
1058 return true;
1059 }
1060
1061 if (!self::getContextUserId())
1062 {
1063 return false;
1064 }
1065
1066 if (Manager::isAdmin())
1067 {
1068 if (in_array($code, self::REVERSE_RIGHTS))
1069 {
1070 return false;
1071 }
1072 return true;
1073 }
1074
1075 $accessCodes = [];
1076 if (!isset($options[$code]))
1077 {
1078 $options[$code] = Manager::getOption('access_codes_' . $code, '');
1079 $options[$code] = unserialize($options[$code], ['allowed_classes' => false]);
1080 }
1081 $option = $options[$code];
1082
1083 if (!is_array($option) && !$strict)
1084 {
1085 return true;
1086 }
1087
1088 if (empty($option))
1089 {
1090 return false;
1091 }
1092
1093 if (self::isExtendedMode())
1094 {
1095 if (isset($option[0]) && is_array($option[0]))
1096 {
1097 $accessCodes = $option[0];
1098 }
1099 }
1100 else
1101 {
1102 if (isset($option[0]))
1103 {
1104 unset($option[0]);
1105 }
1106 foreach ($option as $roleAccess)
1107 {
1108 $accessCodes = array_merge($accessCodes, (array)$roleAccess);
1109 }
1110 $accessCodes = array_unique($accessCodes);
1111 }
1112
1113 if ($accessCodes)
1114 {
1115 static $accessCodesStatic = [];
1116
1117 sort($accessCodes);
1118 $accessCodesStr = implode('|', $accessCodes);
1119
1120 if (array_key_exists($accessCodesStr, $accessCodesStatic))
1121 {
1122 return $accessCodesStatic[$accessCodesStr];
1123 }
1124
1125 $res = UserAccessTable::getList([
1126 'select' => [
1127 'USER_ID'
1128 ],
1129 'filter' => [
1130 '=ACCESS_CODE' => $accessCodes,
1131 'USER_ID' => self::getContextUserId()
1132 ]
1133 ]);
1134 $accessCodesStatic[$accessCodesStr] = (boolean)$res->fetch();
1135 return $accessCodesStatic[$accessCodesStr];
1136 }
1137
1138 return false;
1139 }
1140
1141 return false;
1142 }
1143}
static getOption($code, $default=null)
Definition manager.php:160
const FEATURE_PERMISSIONS_AVAILABLE
Definition manager.php:42
static setOption($code, $value)
Definition manager.php:171
static getCacheManager()
Definition manager.php:89
static checkFeature(string $feature, array $params=array())
Definition manager.php:831
static hasAccessForLanding($landingId, $accessType)
Definition rights.php:578
static setAdditionalRightExtended($code, array $accessCodes=[])
Definition rights.php:892
static setOperationsForSite($siteId, array $rights=[])
Definition rights.php:675
static hasExtraRights()
Definition rights.php:988
static getAccessTasks()
Definition rights.php:208
static removeDataForSite($siteId)
Definition rights.php:278
static setContextUserId(int $uid)
Definition rights.php:166
static getOperations($entityId, $entityType)
Definition rights.php:398
static setOperations($entityId, $entityType, array $rights=[])
Definition rights.php:624
static removeData($entityId, $entityType)
Definition rights.php:253
static getAccessFilter(array $additionalFilterOr=[])
Definition rights.php:724
static getAccessTasksReferences()
Definition rights.php:232
static getDataForSite($siteId, array $preDefined=[])
Definition rights.php:383
static getOperationsForSite($siteId)
Definition rights.php:518
static isExtendedMode()
Definition rights.php:781
static getAllowedSites()
Definition rights.php:156
static getAdditionalRightExtended($code)
Definition rights.php:910
static clearContextUserId()
Definition rights.php:175
static getAdditionalRightsLabels()
Definition rights.php:957
static getData($entityId, $entityType, array $preDefined=[])
Definition rights.php:293
static hasAdditionalRight($code, $type=null, bool $checkExtraRights=false, bool $strict=false)
Definition rights.php:1025
static hasAccessForSite($siteId, $accessType, $deleted=false)
Definition rights.php:544
static refreshAdditionalRights(array $additionalRights=[])
Definition rights.php:812
static getContextUserId()
Definition rights.php:184
static setGlobalOff()
Definition rights.php:105
static $globalAvailable
Definition rights.php:75
static getExpectedRoleIds()
Definition role.php:566
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
static getList(array $parameters=array())