Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * This file is part of the Kdyby (http://www.kdyby.org)
- *
- * Copyright (c) 2008, 2011 Filip Procházka ([email protected])
- *
- * @license http://www.kdyby.org/license
- */
- namespace Kdyby\Security;
- use Kdyby;
- use Nette;
- /**
- * @author Filip Procházka <[email protected]>
- */
- class Permission extends Nette\Security\Permission
- {
- public function allow($roles = self::ALL, $resources = self::ALL, $privileges = self::ALL, $assertion = NULL)
- {
- $this->setRule(TRUE, self::ALLOW, $roles, $resources, $privileges, $assertion ?: array($this, 'checkOwnership'));
- return $this;
- }
- public function checkOwnership(Permission $that, $role, $resource, $privilege)
- {
- // todo
- return TRUE;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment