Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @param array $privileges
- * @param string $resource
- * @param string $action
- * @return array
- */
- private function searchPrivileges($privileges, $resource, $action)
- {
- return Kdyby\Tools\Arrays::flatFilter($privileges, function (Privilege $privilege) use ($resource, $action) {
- return ($resource === '*' || $resource === $privilege->getResource()->getName())
- && ($action === '*' || $action === $privilege->getAction()->getName());
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment