PHP 클래스 dektrium\rbac\migrations\Migration

저자: Dmitry Erofeev ([email protected])
상속: extends yii\base\Component, implements yii\db\MigrationInterface
파일 보기 프로젝트 열기: dektrium/yii2-rbac

공개 프로퍼티들

프로퍼티 타입 설명
$authManager The auth manager component ID that this migration should work with.

공개 메소드들

메소드 설명
down ( ) : boolean This method contains the logic to be executed when removing this migration.
init ( ) Initializes the migration.
safeDown ( ) : boolean This method contains the logic to be executed when removing this migration.
safeUp ( ) : boolean This method contains the logic to be executed when applying this migration.
up ( ) : boolean This method contains the logic to be executed when applying this migration.

보호된 메소드들

메소드 설명
addChild ( Item | string $parent, Item | string $child ) Adds child.
assign ( string | Role $role, string | integer $userId ) Assigns a role to a user.
createPermission ( string $name, string $description = '', string | null $ruleName = null, mixed | null $data = null ) : Permission Creates new permission.
createRole ( string $name, string $description = '', string | null $ruleName = null, mixed | null $data = null ) : Role Creates new role.
createRule ( string $ruleName, string | array $definition ) : Rule Creates new rule.
findItem ( string $name ) : Permission | Role | null Finds either role or permission or throws an exception if it is not found.
findPermission ( string $name ) : Permission | null Finds the permission or throws an exception if it is not found.
findRole ( string $name ) : Role | null Finds the role or throws an exception if it is not found.
removeItem ( string | Item $item ) Removes auth item.
updatePermission ( string | Permission $permission, string $description = '', string $ruleName = null, mixed $data = null ) : Permission Updates permission.
updateRole ( string | Role $role, string $description = '', string $ruleName = null, mixed $data = null ) : Role Updates role.
updateRule ( string $ruleName, string $className ) : Rule Updates rule.

메소드 상세

addChild() 보호된 메소드

Adds child.
protected addChild ( Item | string $parent, Item | string $child )
$parent yii\rbac\Item | string Either name or Item instance which is parent
$child yii\rbac\Item | string Either name or Item instance which is child

assign() 보호된 메소드

Assigns a role to a user.
protected assign ( string | Role $role, string | integer $userId )
$role string | yii\rbac\Role
$userId string | integer

createPermission() 보호된 메소드

Creates new permission.
protected createPermission ( string $name, string $description = '', string | null $ruleName = null, mixed | null $data = null ) : Permission
$name string The name of the permission
$description string The description of the permission
$ruleName string | null The rule associated with the permission
$data mixed | null The additional data associated with the permission
리턴 yii\rbac\Permission

createRole() 보호된 메소드

Creates new role.
protected createRole ( string $name, string $description = '', string | null $ruleName = null, mixed | null $data = null ) : Role
$name string The name of the role
$description string The description of the role
$ruleName string | null The rule associated with the role
$data mixed | null The additional data associated with the role
리턴 yii\rbac\Role

createRule() 보호된 메소드

Creates new rule.
protected createRule ( string $ruleName, string | array $definition ) : Rule
$ruleName string The name of the rule
$definition string | array The class of the rule
리턴 yii\rbac\Rule

down() 공개 메소드

The default implementation throws an exception indicating the migration cannot be removed. Child classes should not override this method, but use safeDown instead.
public down ( ) : boolean
리턴 boolean return a false value to indicate the migration fails and should not proceed further. All other return values mean the migration succeeds.

findItem() 보호된 메소드

Finds either role or permission or throws an exception if it is not found.
protected findItem ( string $name ) : Permission | Role | null
$name string
리턴 yii\rbac\Permission | yii\rbac\Role | null

findPermission() 보호된 메소드

Finds the permission or throws an exception if it is not found.
protected findPermission ( string $name ) : Permission | null
$name string
리턴 yii\rbac\Permission | null

findRole() 보호된 메소드

Finds the role or throws an exception if it is not found.
protected findRole ( string $name ) : Role | null
$name string
리턴 yii\rbac\Role | null

init() 공개 메소드

This method will set [[authManager]] to be the 'authManager' application component, if it is null.
public init ( )

removeItem() 보호된 메소드

Removes auth item.
protected removeItem ( string | Item $item )
$item string | yii\rbac\Item Either item name or item instance to be removed.

safeDown() 공개 메소드

This method contains the logic to be executed when removing this migration.
public safeDown ( ) : boolean
리턴 boolean return a false value to indicate the migration fails and should not proceed further. All other return values mean the migration succeeds.

safeUp() 공개 메소드

This method contains the logic to be executed when applying this migration.
public safeUp ( ) : boolean
리턴 boolean return a false value to indicate the migration fails and should not proceed further. All other return values mean the migration succeeds.

up() 공개 메소드

Child classes should not override this method, but use safeUp instead.
public up ( ) : boolean
리턴 boolean return a false value to indicate the migration fails and should not proceed further. All other return values mean the migration succeeds.

updatePermission() 보호된 메소드

Updates permission.
protected updatePermission ( string | Permission $permission, string $description = '', string $ruleName = null, mixed $data = null ) : Permission
$permission string | yii\rbac\Permission
$description string
$ruleName string
$data mixed
리턴 yii\rbac\Permission

updateRole() 보호된 메소드

Updates role.
protected updateRole ( string | Role $role, string $description = '', string $ruleName = null, mixed $data = null ) : Role
$role string | yii\rbac\Role
$description string
$ruleName string
$data mixed
리턴 yii\rbac\Role

updateRule() 보호된 메소드

Updates rule.
protected updateRule ( string $ruleName, string $className ) : Rule
$ruleName string
$className string
리턴 yii\rbac\Rule

프로퍼티 상세

$authManager 공개적으로 프로퍼티

The auth manager component ID that this migration should work with.
public $authManager