HosipLan

Untitled

Oct 7th, 2011
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1.     /**
  2.      * @param array $privileges
  3.      * @param string $resource
  4.      * @param string $action
  5.      * @return array
  6.      */
  7.     private function searchPrivileges($privileges, $resource, $action)
  8.     {
  9.         return Kdyby\Tools\Arrays::flatFilter($privileges, function (Privilege $privilege) use ($resource, $action) {
  10.             return ($resource === '*' || $resource === $privilege->getResource()->getName())
  11.                 && ($action === '*' || $action === $privilege->getAction()->getName());
  12.         });
  13.     }
  14.  
Advertisement
Add Comment
Please, Sign In to add comment