示例#1
0
 /**
  * Add a new role.
  * 
  * @param string $roleName The name of the role.
  * @param text $description The description of the role.
  * @param int $level Defines the importance of the role. Default is 0.
  * @return void
  **/
 public function addRole($roleName, $description, $level = 0)
 {
     if (!$this->roles->exists($roleName, true)) {
         return $this->roles->addRole($roleName, $description, $level);
     }
     throw new \InvalidArgumentException("Role doesn't exist or is soft-deleted");
 }