src/wcmf/lib/security/impl/AbstractPermissionManager.php
protected function matchRole(User $user, $role, $resource) {
    $isDynamicRole = isset($this->dynamicRoles[$role]);
    return (($isDynamicRole && $this->dynamicRoles[$role]->match($user, $resource) === true)
            || (!$isDynamicRole && $user->hasRole($role)));
  }
protected function matchRole(User $user, $role, $resource) {
    $isDynamicRole = isset($this->dynamicRoles[$role]);
    return (($isDynamicRole && $this->dynamicRoles[$role]->match($user, $resource) === true)
            || (!$isDynamicRole && $user->hasRole($role)));
  }
protected function matchRole ( User $ user , $ role , $ resource ) { $ isDynamicRole = isset ( $ this -> dynamicRoles [ $ role ] ) ; return ( ( $ isDynamicRole && $ this -> dynamicRoles [ $ role ] -> match ( $ user , $ resource ) === true ) || ( ! $ isDynamicRole && $ user -> hasRole ( $ role ) ) ) ; }
Check if a user matches the role for a resource
@param $user The user instance.
@param $role The role name.
@param $resource The resource string to authorize.
@return Boolean
Check if a user matches the role for a resource