class WildcardPermission implements Wildcard

Constants

WILDCARD_TOKEN

PART_DELIMITER

SUBPART_DELIMITER

Methods

__construct(Model $record)

Create a new wildcard permission matcher.

array
getIndex()

Get the wildcard permission index.

array
getDeniedIndex()

Get the wildcard index of the record's denied permissions.

array
indexPermissions(Collection $permissions)

Build a wildcard index of the given permissions, keyed by guard.

array
buildIndex(array $index, array $parts, string $permission)

Build the wildcard permission index.

bool
implies(string $permission, string $guardName, array $index)

Determine if the wildcard permission implies another permission.

bool
checkIndex(array $permission, array $index)

Check the permission against the wildcard index.

Details

at line 23
__construct(Model $record)

Create a new wildcard permission matcher.

Parameters

Model $record

at line 32
array getIndex()

Get the wildcard permission index.

Return Value

array

at line 43
array getDeniedIndex()

Get the wildcard index of the record's denied permissions.

Return Value

array

at line 54
protected array indexPermissions(Collection $permissions)

Build a wildcard index of the given permissions, keyed by guard.

Parameters

Collection $permissions

Return Value

array

at line 76
protected array buildIndex(array $index, array $parts, string $permission)

Build the wildcard permission index.

Parameters

array $index
array $parts
string $permission

Return Value

array

at line 110
bool implies(string $permission, string $guardName, array $index)

Determine if the wildcard permission implies another permission.

Parameters

string $permission
string $guardName
array $index

Return Value

bool

at line 127
protected bool checkIndex(array $permission, array $index)

Check the permission against the wildcard index.

Parameters

array $permission
array $index

Return Value

bool