class MenuItemPolicy extends Policy

Class MenuItemPolicy

Properties

protected PermissionHandler $perm PermissionHandler instance from Policy
protected VirtualGroupRepositoryInterface $vgroups VirtualGroupRepository instance from Policy

Methods

__construct(PermissionHandler $perm, VirtualGroupRepositoryInterface $vgroups)

Policy constructor.

from Policy
Permission|null
get(string $name, string $siteKey = 'default')

Get a permission

from Policy
bool
check(UserInterface $user, Permission $permission, string $action)

Check allows

from Policy
array
extractExcepts(array $grants)

Extract except user information

from Policy
bool
isExcepted(UserInterface $user, array $userIds = array())

Check except user

from Policy
bool
checker(UserInterface $user, string $type, mixed $value)

타입에 맞는 권한 판별 메서드를 호출 함.

from Policy
bool
groupInspect(UserInterface $user, array $criterion)

User 가 속한 그룹이 권한이 있는지 판별.

from Policy
bool
vgroupInspect(UserInterface $user, array $criterion)

User 가 속한 가상그룹이 권한이 있는지 판별.

from Policy
bool
userInspect(UserInterface $user, array $criterion)

User 가 권한이 있는 대상으로 지정되어 있는지 판별

from Policy
bool
ratingInspect(UserInterface $user, string $criterion)

User 가 권한이 있는 등급인지 판별

from Policy
string
userRating(UserInterface $user)

Get a User's rating keyword

from Policy
bool
isGuest(UserInterface $user)

전달된 사용자가 guest 인지 확인

from Policy
bool
access(UserInterface $user, MenuItem $item, Menu $menu = null)

Check access allows

bool
visible(UserInterface $user, MenuItem $item, Menu $menu = null)

Check visible allows

array
getItemBreadcrumbs(MenuItem $item, Menu $menu = null)

Returns breadcrumbs for permission

Details

in Policy at line 53
__construct(PermissionHandler $perm, VirtualGroupRepositoryInterface $vgroups)

Policy constructor.

Parameters

PermissionHandler $perm PermissionHandler instance
VirtualGroupRepositoryInterface $vgroups VirtualGroupRepository instance

in Policy at line 66
protected Permission|null get(string $name, string $siteKey = 'default')

Get a permission

Parameters

string $name permission name
string $siteKey site key name

Return Value

Permission|null

in Policy at line 79
protected bool check(UserInterface $user, Permission $permission, string $action)

Check allows

Parameters

UserInterface $user user instance
Permission $permission permission instance
string $action action keyword

Return Value

bool

in Policy at line 108
protected array extractExcepts(array $grants)

Extract except user information

Parameters

array $grants all grants information

Return Value

array user identifiers

in Policy at line 126
protected bool isExcepted(UserInterface $user, array $userIds = array())

Check except user

Parameters

UserInterface $user user instance
array $userIds except target identifiers

Return Value

bool

in Policy at line 143
protected bool checker(UserInterface $user, string $type, mixed $value)

타입에 맞는 권한 판별 메서드를 호출 함.

Parameters

UserInterface $user user instance
string $type check type
mixed $value given value

Return Value

bool

in Policy at line 157
protected bool groupInspect(UserInterface $user, array $criterion)

User 가 속한 그룹이 권한이 있는지 판별.

Parameters

UserInterface $user user instance
array $criterion criterion group ids

Return Value

bool

in Policy at line 176
protected bool vgroupInspect(UserInterface $user, array $criterion)

User 가 속한 가상그룹이 권한이 있는지 판별.

Parameters

UserInterface $user user instance
array $criterion criterion vgroup ids

Return Value

bool

in Policy at line 199
protected bool userInspect(UserInterface $user, array $criterion)

User 가 권한이 있는 대상으로 지정되어 있는지 판별

Parameters

UserInterface $user user instance
array $criterion criterion user ids

Return Value

bool

in Policy at line 215
protected bool ratingInspect(UserInterface $user, string $criterion)

User 가 권한이 있는 등급인지 판별

Parameters

UserInterface $user user instance
string $criterion user rating keyword

Return Value

bool

in Policy at line 230
protected string userRating(UserInterface $user)

Get a User's rating keyword

Parameters

UserInterface $user user instance

Return Value

string

in Policy at line 245
protected bool isGuest(UserInterface $user)

전달된 사용자가 guest 인지 확인

Parameters

UserInterface $user user instance

Return Value

bool

at line 42
bool access(UserInterface $user, MenuItem $item, Menu $menu = null)

Check access allows

Parameters

UserInterface $user user instance
MenuItem $item menu item instance
Menu $menu menu instance

Return Value

bool

at line 57
bool visible(UserInterface $user, MenuItem $item, Menu $menu = null)

Check visible allows

Parameters

UserInterface $user user instance
MenuItem $item menu item instance
Menu $menu menu instance

Return Value

bool

at line 71
private array getItemBreadcrumbs(MenuItem $item, Menu $menu = null)

Returns breadcrumbs for permission

Parameters

MenuItem $item menu item instance
Menu $menu menu instance

Return Value

array