migrations/Migration.php
protected function createPermission($name, $description = '', $ruleName = null, $data = null)
    {
        echo "    > create permission $name ...";
        $time       = microtime(true);
        $permission = $this->authManager->createPermission($name);

        $permission->description = $description;
        $permission->ruleName    = $ruleName;
        $permission->data        = $data;

        $this->authManager->add($permission);
        echo ' done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n";

        return $permission;
    }
protected function createPermission($name, $description = '', $ruleName = null, $data = null)
    {
        echo "    > create permission $name ...";
        $time       = microtime(true);
        $permission = $this->authManager->createPermission($name);

        $permission->description = $description;
        $permission->ruleName    = $ruleName;
        $permission->data        = $data;

        $this->authManager->add($permission);
        echo ' done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n";

        return $permission;
    }
protected function createPermission ( $ name , $ description = '' , $ ruleName = null , $ data = null ) { echo "    > create permission $name ..." ; $ time = microtime ( true ) ; $ permission = $ this -> authManager -> createPermission ( $ name ) ; $ permission -> description = $ description ; $ permission -> ruleName = $ ruleName ; $ permission -> data = $ data ; $ this -> authManager -> add ( $ permission ) ; echo ' done (time: ' . sprintf ( '%.3f' , microtime ( true ) - $ time ) . "s)\n" ; return $ permission ; }
Creates new permission.

@param  string      $name        The name of the permission
@param  string      $description The description of the permission
@param  string|null $ruleName    The rule associated with the permission
@param  mixed|null  $data        The additional data associated with the permission
@return Permission
Creates new permission .