class Role

角色action

Traits

AppTrait

Pam Trait Pam 的验证, 设置, 获取

Properties

protected Resp $error error from  AppTrait
protected Resp $success success from  AppTrait
protected $pam from  PamTrait
protected PamRole $role

Methods

getError()

获取错误

from  AppTrait
bool
setError(string|MessageBag $error)

设置错误

from  AppTrait
getSuccess()

Get success messages;

from  AppTrait
bool
setSuccess(Resp|string $success)

No description

from  AppTrait
getPam()

No description

from  PamTrait
$this|PamTrait
setPam(PamAccount|Authenticatable|int $pam)

Set Pam Account.

from  PamTrait
bool
checkPam()

检查 pam 用户

from  PamTrait
bool
checkPermission(string $permission_key)

检测当前用户是否存在权限

from  PamTrait
coreModule()

获取核心的模块

bool
establish(array $data, int $id = null)

创建需求

bool
savePermission(int $role_id, array $permission_ids)

保存权限

void
init(int $id)

No description

getRole()

No description

array|bool
permissions(int $id, bool $has_key = true)

获取所有权限以及默认值

bool
delete(int $id)

删除数据

Details

in AppTrait at line 32
Resp getError()

获取错误

Return Value

Resp

in AppTrait at line 45
bool setError(string|MessageBag $error)

设置错误

Parameters

string|MessageBag $error error

Return Value

bool

in AppTrait at line 82
Resp getSuccess()

Get success messages;

Return Value

Resp

in AppTrait at line 100
bool setSuccess(Resp|string $success)

No description

Parameters

Resp|string $success 设置的成功信息

Return Value

bool

in PamTrait at line 25
PamAccount getPam()

No description

Return Value

PamAccount

in PamTrait at line 36
$this|PamTrait setPam(PamAccount|Authenticatable|int $pam)

Set Pam Account.

Parameters

PamAccount|Authenticatable|int $pam 用户

Return Value

$this|PamTrait

in PamTrait at line 52
bool checkPam()

检查 pam 用户

Return Value

bool

in PamTrait at line 66
bool checkPermission(string $permission_key)

检测当前用户是否存在权限

Parameters

string $permission_key 权限KEY

Return Value

bool

in CoreTrait at line 16
ModuleManager coreModule()

获取核心的模块

Return Value

ModuleManager

in CoreTrait at line 25
PermissionManager corePermission()

权限管理

Return Value

PermissionManager

at line 35
bool establish(array $data, int $id = null)

创建需求

Parameters

array $data 创建数据
int $id 角色id

Return Value

bool

at line 64
bool savePermission(int $role_id, array $permission_ids)

保存权限

Parameters

int $role_id 角色ID
array $permission_ids 所有的权限列表

Return Value

bool

at line 97
void init(int $id)

No description

Parameters

int $id 角色id

Return Value

void

at line 102
PamRole getRole()

No description

Return Value

PamRole

at line 113
array|bool permissions(int $id, bool $has_key = true)

获取所有权限以及默认值

Parameters

int $id 角色id
bool $has_key 是否有值

Return Value

array|bool

at line 199
bool delete(int $id)

删除数据

Parameters

int $id 角色id

Return Value

bool

Exceptions

Exception