Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
PermissionArticles.php
1
<?php
2
3
namespace
Bitrix\Catalog\Access\Permission
;
4
5
use
Bitrix\Catalog\Access\Component\PermissionConfig
;
6
use
Bitrix\Main\Localization\Loc
;
7
8
class
PermissionArticles
9
{
10
private
const
PERMISSIONS_ARTICLES = [
11
PermissionDictionary::CATALOG_INVENTORY_MANAGEMENT_ACCESS
=> 16342604,
12
PermissionDictionary::CATALOG_STORE_VIEW
=> 16342618,
13
PermissionDictionary::CATALOG_RESERVE_SETTINGS
=> 16342830,
14
PermissionDictionary::CATALOG_SETTINGS_ACCESS
=> 16377052,
15
PermissionDictionary::CATALOG_SETTINGS_EDIT_RIGHTS
=> 16377052,
16
PermissionDictionary::CATALOG_SETTINGS_SELL_NEGATIVE_COMMODITIES
=> 16377052,
17
PermissionDictionary::CATALOG_SETTINGS_PRODUCT_CARD_EDIT
=> 16342856,
18
PermissionDictionary::CATALOG_SETTINGS_PRODUCT_CARD_SET_PROFILE_FOR_USERS
=> 16342856,
19
PermissionDictionary::CATALOG_PRODUCT_EDIT_CATALOG_PRICE
=> 16342446,
20
PermissionDictionary::CATALOG_PRODUCT_EDIT_ENTITY_PRICE
=> 16342542,
21
PermissionDictionary::CATALOG_PRODUCT_PUBLIC_VISIBILITY
=> 16342560,
22
PermissionDictionary::CATALOG_SETTINGS_STORE_DOCUMENT_CARD_EDIT
=> 16342652,
23
PermissionDictionary::CATALOG_EXPORT_EXECUTION
=> 16342582,
24
PermissionDictionary::CATALOG_IMPORT_EXECUTION
=> 16342582,
25
];
26
private
const
SECTION_ARTICLES = [
27
PermissionConfig::SECTION_STORE_DOCUMENT_ARRIVAL
=> 16342676,
28
PermissionConfig::SECTION_STORE_DOCUMENT_STORE_ADJUSTMENT
=> 16342722,
29
PermissionConfig::SECTION_STORE_DOCUMENT_MOVING
=> 16342750,
30
PermissionConfig::SECTION_STORE_DOCUMENT_DEDUCT
=> 16342812,
31
PermissionConfig::SECTION_STORE_DOCUMENT_SALES_ORDER
=> 16342768,
32
];
33
34
private
function
getLinkHtml(
int
$code):
string
35
{
36
$onclick =
"top.BX.Helper.show('redirect=detail&code={$code}'); return false;"
;
37
$text =
Loc::getMessage
(
'CATALOG_PERMISSION_DICTIONARY_ARTICLES_LINK_TEXT'
);
38
39
return
'<a href="javascript:;" onclick="'
. $onclick .
'">'
. $text .
'</a>'
;
40
}
41
49
public
function
getPermissionArticleLink
(
string
$permissionId): ?string
50
{
51
$code = self::PERMISSIONS_ARTICLES[$permissionId] ??
null
;
52
if
(!$code)
53
{
54
return
null
;
55
}
56
57
return
$this->getLinkHtml($code);
58
}
59
67
public
function
getSectionArticleLink
(
string
$sectionCode): ?string
68
{
69
$code = self::SECTION_ARTICLES[$sectionCode] ??
null
;
70
if
(!$code)
71
{
72
return
null
;
73
}
74
75
return
$this->getLinkHtml($code);
76
}
77
}
Bitrix\Catalog\Access\Component\PermissionConfig\SECTION_STORE_DOCUMENT_ARRIVAL
const SECTION_STORE_DOCUMENT_ARRIVAL
Definition
PermissionConfig.php:25
Bitrix\Catalog\Access\Component\PermissionConfig\SECTION_STORE_DOCUMENT_STORE_ADJUSTMENT
const SECTION_STORE_DOCUMENT_STORE_ADJUSTMENT
Definition
PermissionConfig.php:26
Bitrix\Catalog\Access\Component\PermissionConfig\SECTION_STORE_DOCUMENT_DEDUCT
const SECTION_STORE_DOCUMENT_DEDUCT
Definition
PermissionConfig.php:28
Bitrix\Catalog\Access\Component\PermissionConfig\SECTION_STORE_DOCUMENT_MOVING
const SECTION_STORE_DOCUMENT_MOVING
Definition
PermissionConfig.php:27
Bitrix\Catalog\Access\Component\PermissionConfig\SECTION_STORE_DOCUMENT_SALES_ORDER
const SECTION_STORE_DOCUMENT_SALES_ORDER
Definition
PermissionConfig.php:29
Bitrix\Catalog\Access\Permission\PermissionArticles
Definition
PermissionArticles.php:9
Bitrix\Catalog\Access\Permission\PermissionArticles\getSectionArticleLink
getSectionArticleLink(string $sectionCode)
Definition
PermissionArticles.php:67
Bitrix\Catalog\Access\Permission\PermissionArticles\getPermissionArticleLink
getPermissionArticleLink(string $permissionId)
Definition
PermissionArticles.php:49
Bitrix\Catalog\Access\Permission\PermissionDictionary\CATALOG_PRODUCT_PUBLIC_VISIBILITY
const CATALOG_PRODUCT_PUBLIC_VISIBILITY
Definition
PermissionDictionary.php:62
Bitrix\Catalog\Access\Permission\PermissionDictionary\CATALOG_SETTINGS_PRODUCT_CARD_SET_PROFILE_FOR_USERS
const CATALOG_SETTINGS_PRODUCT_CARD_SET_PROFILE_FOR_USERS
Definition
PermissionDictionary.php:44
Bitrix\Catalog\Access\Permission\PermissionDictionary\CATALOG_IMPORT_EXECUTION
const CATALOG_IMPORT_EXECUTION
Definition
PermissionDictionary.php:64
Bitrix\Catalog\Access\Permission\PermissionDictionary\CATALOG_PRODUCT_EDIT_CATALOG_PRICE
const CATALOG_PRODUCT_EDIT_CATALOG_PRICE
Definition
PermissionDictionary.php:59
Bitrix\Catalog\Access\Permission\PermissionDictionary\CATALOG_SETTINGS_SELL_NEGATIVE_COMMODITIES
const CATALOG_SETTINGS_SELL_NEGATIVE_COMMODITIES
Definition
PermissionDictionary.php:42
Bitrix\Catalog\Access\Permission\PermissionDictionary\CATALOG_SETTINGS_PRODUCT_CARD_EDIT
const CATALOG_SETTINGS_PRODUCT_CARD_EDIT
Definition
PermissionDictionary.php:43
Bitrix\Catalog\Access\Permission\PermissionDictionary\CATALOG_STORE_VIEW
const CATALOG_STORE_VIEW
Definition
PermissionDictionary.php:26
Bitrix\Catalog\Access\Permission\PermissionDictionary\CATALOG_RESERVE_SETTINGS
const CATALOG_RESERVE_SETTINGS
Definition
PermissionDictionary.php:46
Bitrix\Catalog\Access\Permission\PermissionDictionary\CATALOG_EXPORT_EXECUTION
const CATALOG_EXPORT_EXECUTION
Definition
PermissionDictionary.php:63
Bitrix\Catalog\Access\Permission\PermissionDictionary\CATALOG_SETTINGS_ACCESS
const CATALOG_SETTINGS_ACCESS
Definition
PermissionDictionary.php:40
Bitrix\Catalog\Access\Permission\PermissionDictionary\CATALOG_PRODUCT_EDIT_ENTITY_PRICE
const CATALOG_PRODUCT_EDIT_ENTITY_PRICE
Definition
PermissionDictionary.php:60
Bitrix\Catalog\Access\Permission\PermissionDictionary\CATALOG_INVENTORY_MANAGEMENT_ACCESS
const CATALOG_INVENTORY_MANAGEMENT_ACCESS
Definition
PermissionDictionary.php:24
Bitrix\Catalog\Access\Permission\PermissionDictionary\CATALOG_SETTINGS_EDIT_RIGHTS
const CATALOG_SETTINGS_EDIT_RIGHTS
Definition
PermissionDictionary.php:41
Bitrix\Catalog\Access\Permission\PermissionDictionary\CATALOG_SETTINGS_STORE_DOCUMENT_CARD_EDIT
const CATALOG_SETTINGS_STORE_DOCUMENT_CARD_EDIT
Definition
PermissionDictionary.php:45
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\Catalog\Access\Component\PermissionConfig
Definition
RoleMembersInfo.php:3
Bitrix\Catalog\Access\Permission
modules
catalog
lib
Access
Permission
PermissionArticles.php
Создано системой
1.10.0