class Rule

Rule class.

Methods

__construct( mixed $identities)

Constructor.

array
getData()

Get the data for the action.

void
mergeIdentities( mixed $identities)

Merges the identities

void
mergeIdentity( integer $identity, boolean $allow)

Merges the values for an identity.

mixed
allow( mixed $identities)

Checks that this action can be performed by an identity.

string
__toString()

Convert this object into a JSON encoded string.

Details

__construct( mixed $identities)

Constructor.

The input array must be in the form: array(-42 => true, 3 => true, 4 => false) or an equivalent JSON encoded string.

Parameters

mixed $identities A JSON format string (probably from the database) or a named array.

array getData()

Get the data for the action.

Return Value

array A named array

void mergeIdentities( mixed $identities)

Merges the identities

Parameters

mixed $identities An integer or array of integers representing the identities to check.

Return Value

void

void mergeIdentity( integer $identity, boolean $allow)

Merges the values for an identity.

Parameters

integer $identity The identity.
boolean $allow The value for the identity (true == allow, false == deny).

Return Value

void

mixed allow( mixed $identities)

Checks that this action can be performed by an identity.

The identity is an integer where +ve represents a user group, and -ve represents a user.

Parameters

mixed $identities An integer or array of integers representing the identities to check.

Return Value

mixed True if allowed, false for an explicit deny, null for an implicit deny.

string __toString()

Convert this object into a JSON encoded string.

Return Value

string JSON encoded string