class RolePermissionsExtension extends Twig_Extension

Class RolePermissionsExtension is injected as user_plugin.role_permissions.twig_extension service. RolePermissionsExtension handles the logic and provides necessary data for managed entity in twig.

Properties

protected RolePermissionsManager $manager

Methods

__construct(RolePermissionsManager $manager)

RolePermissionsExtension constructor.

getFunctions()

{@inheritdoc}

array
getRolePermissions()

No description

array
getProductRolePermissions()

No description

bool
checkUserAddToCartPermission()

Check if user has permission to add to cart

bool
checkProductAddToCartPermission(array|string $permissions)

Check if user or product have add to cart permission

string
getName()

Returns the name of the extension.

Details

at line 28
__construct(RolePermissionsManager $manager)

RolePermissionsExtension constructor.

Parameters

RolePermissionsManager $manager

at line 36
getFunctions()

{@inheritdoc}

at line 49
array getRolePermissions()

Return Value

array

at line 57
array getProductRolePermissions()

Return Value

array

at line 66
bool checkUserAddToCartPermission()

Check if user has permission to add to cart

Return Value

bool

at line 77
bool checkProductAddToCartPermission(array|string $permissions)

Check if user or product have add to cart permission

Parameters

array|string $permissions

Return Value

bool

at line 87
string getName()

Returns the name of the extension.

Return Value

string The extension name