Rules

Access rules class.

since

2.5.0

package

Joomla CMS

Methods

__construct

Constructor.

__construct( input = '') : 

The input array must be in the form: array('action' => array(-42 => true, 3 => true, 4 => false)) or an equivalent JSON encoded string, or an object where properties are arrays.

since

1.7.0

Arguments

input

mixedA JSON format string (probably from the database) or a nested array.

Response

mixed

__toString

Magic method to convert the object to JSON string representation.

__toString() : 
since

1.7.0

Response

stringJSON representation of the actions array

allow

Checks that an action can be performed by an identity.

allow( action,  identity) : 

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

since

1.7.0

Arguments

action

stringThe name of the action.

identity

mixedAn integer representing the identity, or an array of identities

Response

mixedObject or null if there is no information about the action.

getAllowed

Get the allowed actions for an identity.

getAllowed( identity) : \Joomla\CMS\Object\CMSObject
since

1.7.0

Arguments

identity

mixedAn integer representing the identity or an array of identities

Response

CMSObjectAllowed actions for the identity or identities

getData

Get the data for the action.

getData() : mixed||string|int
since

1.7.0

Response

array<string|int, mixed>A named array of Rule objects.

merge

Method to merge actions with this object.

merge( actions) : 
since

1.7.0

Arguments

actions

mixedRule object, an array of actions or a JSON string array of actions.

Response

void

mergeAction

Merges an array of identities for an action.

mergeAction( action, mixed||string|int identities) : 
since

1.7.0

Arguments

action

stringThe name of the action.

identities

array<string|int, mixed>An array of identities

Response

void

mergeCollection

Method to merge a collection of Rules.

mergeCollection( input) : 
since

1.7.0

Arguments

input

mixedRule or array of Rules

Response

void

Properties

data

A named array.

since

1.7.0

Type(s)

array<string|int, mixed>