SilverStripe\CMS\Model\SiteTree::can
This function should return true if the current user can execute this action. It can be overloaded to customise the security model for an application.
Slightly altered from parent behaviour in : - Checks for existence of a method named "can<$perm>()" on the object - Calls decorators and only returns for FALSE "vetoes" - Falls back to - Does NOT check for many-many relations named "Can<$perm>"
Signature
public function can(string
$perm,
[Member
$member = NULL,
[array
$context = ]] )
Parameters
$perm
— string- The permission to be checked, such as 'View'
$member
— object- The member whose permissions need checking. Defaults to the currently logged in user.
$context
— array- Context argument for canCreate()
Returns
- bool
- True if the the member is allowed to do the given action