PHP Class Psecio\PropAuth\Policy

Datei anzeigen Open project: psecio/propauth Class Usage Examples

Public Methods

Method Description
__call ( string $name, array $args ) : Policy Magic method to catch policy additions on the current instance
getChecks ( ) : array Get the full list of current checks on the policy
instance ( ) : Policy Static method to return a new Policy instance
load ( string $dslString ) Load a policy from a string DSL See the README for formatting
passwordEquals ( string $password ) : Enforcer Catch the call to evaluate the password

Protected Methods

Method Description
addCheck ( string $name, string $type, array $args ) Add a new check to the set

Private Methods

Method Description
canCheck ( string $type, string $name, array $args ) Add a "can" check to the set
cannotCheck ( string $type, string $name, array $args ) Add a "cannot" check to the set
check ( string $matchType, string $type, string $name, array $args ) Add a new check to the current set for the policy
hasCheck ( string $type, string $name, array $args ) Add a "has" check to the set
notCheck ( string $type, string $name, array $args ) Add a "not" check to the set

Method Details

__call() public method

Magic method to catch policy additions on the current instance
public __call ( string $name, array $args ) : Policy
$name string Method name
$args array Method arguments
return Policy instance

addCheck() protected method

Add a new check to the set
protected addCheck ( string $name, string $type, array $args )
$name string Function name
$type string Check type
$args array Check arguments

getChecks() public method

Get the full list of current checks on the policy
public getChecks ( ) : array
return array Set of current checks

instance() public static method

Static method to return a new Policy instance
public static instance ( ) : Policy
return Policy

load() public static method

Load a policy from a string DSL See the README for formatting
public static load ( string $dslString )
$dslString string DSL formatted string

passwordEquals() public method

Catch the call to evaluate the password
public passwordEquals ( string $password ) : Enforcer
$password string Plain-text password input
return Enforcer instance