\User\Model\EntityAccessibleEntityTrait

Provides "isAccessible()" method to entities.

Entity must have a relationship with "User.Roles" model.

Summary

Methods
Properties
Constants
isAccessible()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

isAccessible()

isAccessible(array|null $roles) : boolean

Whether this entity can be accessed by current user.

Parameters

array|null $roles

Array list of roles to checks against to, or NULL to automatically use entity's "roles" property

Returns

boolean —

False if user has no permissions to see this entity due to role restrictions, true otherwise