public getPermissions ( string $absPath ) : array | ||
$absPath | string | absolute path to node to get permissions for it |
return | array | of string |
public function getPermissions($absPath)
{
if (!$this->transport instanceof PermissionInterface) {
throw new UnsupportedRepositoryOperationException('Transport does not support permissions');
}
return $this->transport->getPermissions($absPath);
}
/** * {@inheritDoc} * * @api */ public function hasPermission($absPath, $actions) { $actualPermissions = $this->objectManager->getPermissions($absPath); $requestedPermissions = explode(',', $actions); foreach ($requestedPermissions as $perm) { if (!in_array(strtolower(trim($perm)), $actualPermissions)) { return false; } } return true; }