PHP Class ManaPHP\Authorization\Rbac

Inheritance: extends ManaPHP\Component, implements ManaPHP\AuthorizationInterface
Show file Open project: manaphp/manaphp

Protected Properties

Property Type Description
$_permissionModel string
$_rolePermissionModel string
$_userRoleModel string

Public Methods

Method Description
__construct ( array $options = [] ) Rbac constructor.
isAllowed ( string $permissionName, string $userId = null ) : boolean

Protected Methods

Method Description
_getPermissionByName ( string $name ) : false | Permission
_getRolesByPermissionId ( integer $permissionId ) : array
_getRolesByUserId ( string $userId ) : array
_parsePermissionName ( string $permissionName ) : array

Method Details

__construct() public method

Rbac constructor.
public __construct ( array $options = [] )
$options array

_getPermissionByName() protected method

protected _getPermissionByName ( string $name ) : false | Permission
$name string
return false | ManaPHP\Authorization\Rbac\Models\Permission

_getRolesByPermissionId() protected method

protected _getRolesByPermissionId ( integer $permissionId ) : array
$permissionId integer
return array

_getRolesByUserId() protected method

protected _getRolesByUserId ( string $userId ) : array
$userId string
return array

_parsePermissionName() protected method

protected _parsePermissionName ( string $permissionName ) : array
$permissionName string
return array

isAllowed() public method

public isAllowed ( string $permissionName, string $userId = null ) : boolean
$permissionName string
$userId string
return boolean

Property Details

$_permissionModel protected property

protected string $_permissionModel
return string

$_rolePermissionModel protected property

protected string $_rolePermissionModel
return string

$_userRoleModel protected property

protected string $_userRoleModel
return string