yii\rbac\ManagerInterface::createPermission PHP Method

createPermission() public method

Note that the newly created permission is not added to the RBAC system yet. You must fill in the needed data and call ManagerInterface::add to add it to the system.
public createPermission ( string $name ) : Permission
$name string the permission name
return Permission the new Permission object
    public function createPermission($name);

Usage Example

Example #1
0
 /**
  * Remove items
  *
  * @param array $routes
  *
  * @return bool
  */
 public function remove($routes)
 {
     foreach ($routes as $route) {
         $item = $this->manager->createPermission('/' . trim($route, '/'));
         $this->manager->remove($item);
     }
     $this->invalidate();
     return true;
 }
All Usage Examples Of yii\rbac\ManagerInterface::createPermission