/**
  * getDefaultRole
  *
  * Return the default ACL role instance
  * 
  * @return Multiverse\ACL\Roe\IRole
  */
 public function getDefaultRole()
 {
     if (null === $this->defaultRole) {
         $role = $this->getOption('defaultRole', 'Guest');
         $acl = $this->getAclManager();
         if (!$acl->hasRole($role)) {
             if ($role instanceof IRole) {
                 $role = $role->getRoleId();
             }
             throw \BadMethodCallException(sprintf('The default role \'%s\' does not exist within the ACL', $role));
         }
         $this->defaultRole = $acl->getRole($role);
     }
     return $this->defaultRole;
 }
Esempio n. 2
0
 /**
  * You can't serialize this object.
  * 
  * @magic 
  * @access public
  */
 public function __sleep()
 {
     throw BadMethodCallException('This object is not serializable.');
 }