RolePermissionsManager
class RolePermissionsManager implements BasicEntityManagerInterface
Class RolePermissionsManager is injected as user_plugin.role_permissions.manager service. RolePermissionsManager handles the logic for entity.
Properties
| protected RolePermissionsRepository | $repository | ||
| protected RolePermissionsEventContainer | $container |
Methods
RolePermissionsManager constructor.
Save, update or delete permissions
Get array of permissions for role id
Get permissions from cache
Get role permissions and set them to cache
Check if user has permission to add to cart
Check if user or product have add to cart permission
Check if user can see price
Check if product has permission to display price
Check if user can see product quantity
Check if product quantity can be displayed for product
Details
at line 36
__construct(RolePermissionsRepository $repository, RolePermissionsEventContainer $container)
RolePermissionsManager constructor.
at line 50
RolePermissions
save(mixed $json)
Save, update or delete permissions
at line 74
array|null
getPermissionsForRoleId(mixed $roleId)
Get array of permissions for role id
at line 83
mixed
getCachedRolePermissions()
Get permissions from cache
at line 92
array
setRolePermissionsToCache()
Get role permissions and set them to cache
at line 105
bool
checkUserAddToCartPermission()
Check if user has permission to add to cart
at line 124
bool
checkAddToCartPermission(array|string $productPermissions)
Check if user or product have add to cart permission
at line 136
bool
canUserSeePrice()
Check if user can see price
at line 155
bool
checkCanSeePricePermission(array|string $productPermissions)
Check if product has permission to display price
at line 166
bool
canUserSeeQuantity()
Check if user can see product quantity
at line 185
bool
checkCanSeeQuantityPermission(array|string $productPermissions)
Check if product quantity can be displayed for product