You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,16 +13,16 @@ A scenario to setup a role based permission system:
13
13
- Additional data types for Pimcore objects
14
14
- Permission Resource:
15
15
- represents one specific user right (e.g. login)
16
-
- can have values ```allow``````deny``````inherit```
16
+
- can have values `allow``deny``inherit`
17
17
- Permission Objects: Wrapper for default data type `objects` for recursive permission calculation.
18
18
- Permission Href: Wrapper for default data type `href` for recursive permission calculation.
19
19
20
-
- Service for checking user rights based on a Pimcore object and a permission resource as service class ```Service``` with
20
+
- Service for checking user rights based on a Pimcore object and a permission resource as service class `Service` with
21
21
two methods:
22
-
-```Service::getPermissions```:
22
+
-`Service::getPermissions`:
23
23
- returns an array of all permissions for the given object, automatically merges all permission resources of objects related to the given object with 'Permission Objects' or 'Permission Href'.
24
24
- merging: When permission is set to allow / deny directly in object, this is always used. Otherwise optimistic merging is used -> once one permission is allowed, it stays that way.
25
-
-```Service::isAllowed```: checks if given object is allowed for given resource
25
+
-`Service::isAllowed`: checks if given object is allowed for given resource
26
26
27
27
28
28
@@ -52,8 +52,12 @@ As a consequence, you can use Permission Resources in your access control config
52
52
53
53
### Integration with Pimcore navigation
54
54
55
-
To show/hide documents in navigation, you can assign Permission Resources as properties to Pimcore documents. A special
56
-
navigation builder shipped by this bundle (`FrontendPermissionToolkitBundle\CoreExtensions\Navigation\Builder`)
55
+
To show/hide documents in navigation, you can assign Permission Resources as properties to Pimcore documents.
56
+
Just add a property named `permission_resource` with name name of the `permissionResource` as value to the document.
57
+
58
+

59
+
60
+
A special navigation builder shipped by this bundle (`FrontendPermissionToolkitBundle\CoreExtensions\Navigation\Builder`)
57
61
then can show/hide documents in navigation based on the permissions of the current user.
58
62
59
63
To do so, add following service definition to your application:
0 commit comments