Skip to content

Commit 760445b

Browse files
committed
minor wording adjustments for clarity
1 parent deb68a7 commit 760445b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

docs/plugins/permissions.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Mautic defines custom Role permissions through Permission objects.
66
How permissions work
77
********************
88

9-
Mautic calculates permissions based on bits assigned to a Plugin level and permission. Bits are integers that increase by doubling the value - 1, 2, 4, 8, 16, 32, 64, 128, 512, 1024, and so forth. Avoid assigning numbers in between - such as 3 or 5 - because the permission won't calculate correctly.
9+
Mautic calculates permissions based on bits assigned to a Plugin level and permission. Bits are integers that increase by doubling the value - 1, 2, 4, 8, 16, 32, 64, 128, 512, 1024, and so forth. Avoid assigning numbers in between, such as 3 or 5, because the permission won't calculate correctly.
1010

1111
For example, if ``HelloWorldBundle`` manages access to a ``worlds`` entity, the permission set for ``plugin:helloWorld:worlds`` resembles this setup:
1212

@@ -29,9 +29,9 @@ For example, if ``HelloWorldBundle`` manages access to a ``worlds`` entity, the
2929

3030
.. note::
3131

32-
The notation ``plugin:helloWorld:worlds:view`` typically requests permission in Mautic. This notation tells Mautic to verify the ``view`` permission for the Plugin, ``HelloWorldBundle``, within the ``worlds`` level. Levels allow Plugins to set permissions for multiple areas.
32+
The notation ``plugin:helloWorld:worlds:view`` typically requests permission in Mautic. This notation tells Mautic to verify the ``view`` permission for the Plugin ``HelloWorldBundle`` at the ``worlds`` level. Levels allow Plugins to set permissions for multiple areas.
3333

34-
Mautic takes the summation of the bits for the permissions given to a Role and stores it in the database. For example, if a Role has ``view`` and ``edit`` access, the stored bit is 3. If given ``view`` and ``create`` access, the stored bit is 5.
34+
Mautic sums the bits for the permissions granted to a Role and stores the result in the database. For example, if a Role has ``view`` and ``edit`` access, the stored bit is 3. If given ``view`` and ``create`` access, the stored bit is 5.
3535

3636
When permission verification is necessary - for instance ``plugin:helloWorld:worlds:create`` - Mautic verifies if the Role's generated bit for ``plugin:helloWorld:worlds`` includes bit 4. If so, Mautic grants permission.
3737

@@ -92,14 +92,14 @@ Using permissions
9292
// do something
9393
}
9494
95-
To determine if a User has a specific permission, use the Mautic security service which you can obtain from the ``mautic.security`` service.
95+
To determine if a User has a specific permission, use the Mautic security service, which you can obtain from the ``mautic.security`` service.
9696

9797
Mautic uses specific notation to identify permissions:
9898

9999
* **Core bundles**: use the format ``bundleName:permissionLevel:permission``.
100100
* **Plugins**: append the ``plugin:`` prefix. For example, ``plugin:bundleName:permissionLevel:permission``. Plugins require this prefix because it directs Mautic to search for the permission class within the ``plugins/`` directory and the ``MauticPlugin`` namespace.
101101

102-
Core bundles or Plugins set the permission level and permissions. For example, the Core UserBundle has ``users`` and ``roles`` levels with ``view``, ``edit``, ``create``, ``delete``, and ``full`` permissions for each. To verify if a User has permission to edit Roles, use:
102+
Core bundles or Plugins set the permission level and permissions. For example, the core UserBundle has ``users`` and ``roles`` levels with ``view``, ``edit``, ``create``, ``delete``, and ``full`` permissions for each. To verify if a User has permission to edit Roles, use:
103103

104104
.. code-block:: php
105105

0 commit comments

Comments
 (0)