Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Salesman.php
1<?php
10
14
15class Salesman extends Base
16{
17 public function getPermissions(): array
18 {
19 return array_merge(
20 [
21 PermissionDictionary::CATALOG_INVENTORY_MANAGEMENT_ACCESS,
22 PermissionDictionary::CATALOG_STORE_VIEW,
23 PermissionDictionary::CATALOG_STORE_ANALYTIC_VIEW,
24 PermissionDictionary::CATALOG_RESERVE_DEAL,
25 PermissionDictionary::CATALOG_STORE_RESERVE,
26 PermissionDictionary::CATALOG_PRODUCT_VIEW,
27 PermissionDictionary::CATALOG_PRODUCT_READ,
28 PermissionDictionary::CATALOG_PRODUCT_ADD,
29 PermissionDictionary::CATALOG_PRODUCT_EDIT_ENTITY_PRICE,
30 PermissionDictionary::CATALOG_PRODUCT_SET_DISCOUNT,
31 PermissionDictionary::CATALOG_PRODUCT_PUBLIC_VISIBILITY,
32 ],
33 PermissionDictionary::getStoreDocumentPermissionRules(
34 [
35 PermissionDictionary::CATALOG_STORE_DOCUMENT_VIEW,
36 PermissionDictionary::CATALOG_STORE_DOCUMENT_MODIFY,
37 ]
38 ),
39 PermissionDictionary::getStoreDocumentPermissionRules(
40 [
41 PermissionDictionary::CATALOG_STORE_DOCUMENT_CONDUCT,
42 ],
43 [
45 ]
46 )
47 );
48 }
49
50 protected function getPermissionValue($permissionId): array
51 {
52 if (
53 $permissionId === PermissionDictionary::CATALOG_PRODUCT_EDIT_ENTITY_PRICE
54 || $permissionId === PermissionDictionary::CATALOG_PRODUCT_SET_DISCOUNT
55 )
56 {
57 return [\CCrmOwnerType::Deal, \CCrmOwnerType::Lead];
58 }
59
60 return [PermissionDictionary::getDefaultPermissionValue($permissionId)];
61 }
62}