PHP Trait AuthorityControllerHelpers

Show file Open project: efficiently/authority-controller

Protected Properties

Property Type Description
$authority
$user
$userAttributes

Public Methods

Method Description
assertCan ( $action, $resource, $resourceValue = null )
assertCannot ( $action, $resource, $resourceValue = null )
getProperty ( $object, $propertyName )
invokeMethod ( $object, $methodName, $values = [] )
setProperty ( $object, $propertyName, $value )

Protected Methods

Method Description
getAuthority ( $user )
getUser ( Illuminate\Database\Eloquent\Collection $roles = null ) : UserInterface return an Authentificate User with role(s)
getUserWithRole ( string | array $rolesNames = null ) : UserInterface return an Authentificate User with role(s)

Method Details

assertCan() public method

public assertCan ( $action, $resource, $resourceValue = null )

assertCannot() public method

public assertCannot ( $action, $resource, $resourceValue = null )

getAuthority() protected method

protected getAuthority ( $user )

getProperty() public method

public getProperty ( $object, $propertyName )

getUser() protected method

return an Authentificate User with role(s)
protected getUser ( Illuminate\Database\Eloquent\Collection $roles = null ) : UserInterface
$roles Illuminate\Database\Eloquent\Collection Roles to add to the user. Default to null
return UserInterface

getUserWithRole() protected method

return an Authentificate User with role(s)
protected getUserWithRole ( string | array $rolesNames = null ) : UserInterface
$rolesNames string | array Role(s) to add to the user
return UserInterface

invokeMethod() public method

public invokeMethod ( $object, $methodName, $values = [] )

setProperty() public method

public setProperty ( $object, $propertyName, $value )

Property Details

$authority protected property

protected $authority

$user protected property

protected $user

$userAttributes protected property

protected $userAttributes