HosipLan

Untitled

Jan 16th, 2012
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * This file is part of the Kdyby (http://www.kdyby.org)
  5.  *
  6.  * Copyright (c) 2008, 2011 Filip Procházka ([email protected])
  7.  *
  8.  * @license http://www.kdyby.org/license
  9.  */
  10.  
  11. namespace Kdyby\Security;
  12.  
  13. use Kdyby;
  14. use Nette;
  15.  
  16.  
  17.  
  18. /**
  19.  * @author Filip Procházka <[email protected]>
  20.  */
  21. class Permission extends Nette\Security\Permission
  22. {
  23.  
  24.     public function allow($roles = self::ALL, $resources = self::ALL, $privileges = self::ALL, $assertion = NULL)
  25.     {
  26.         $this->setRule(TRUE, self::ALLOW, $roles, $resources, $privileges, $assertion ?: array($this, 'checkOwnership'));
  27.         return $this;
  28.     }
  29.  
  30.     public function checkOwnership(Permission $that, $role, $resource, $privilege)
  31.     {
  32.         // todo
  33.         return TRUE;
  34.     }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment