Rules
Access rules class.
since |
2.5.0 |
---|---|
package |
Joomla CMS |
Methods
__construct
Constructor.
__construct(mixed input = '') : mixed
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
mixed
A 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() : string
since |
1.7.0 |
---|
Response
string
JSON representation of the actions array
allow
Checks that an action can be performed by an identity.
allow(string action, mixed identity) : mixed
The identity is an integer where +ve represents a user group, and -ve represents a user.
since |
1.7.0 |
---|
Arguments
- action
string
The name of the action.- identity
mixed
An integer representing the identity, or an array of identities
Response
mixed
Object or null if there is no information about the action.
getAllowed
Get the allowed actions for an identity.
getAllowed(mixed identity) : \Joomla\CMS\Object\CMSObject
since |
1.7.0 |
---|
Arguments
- identity
mixed
An integer representing the identity or an array of identities
Response
\Joomla\CMS\Object\CMSObject
Allowed actions for the identity or identities
getData
Get the data for the action.
getData() : array
since |
1.7.0 |
---|
Response
array
A named array of Rule objects.
merge
Method to merge actions with this object.
merge(mixed actions) : void
since |
1.7.0 |
---|
Arguments
- actions
mixed
Rule object, an array of actions or a JSON string array of actions.
mergeAction
Merges an array of identities for an action.
mergeAction(string action, array identities) : void
since |
1.7.0 |
---|
Arguments
- action
string
The name of the action.- identities
array
An array of identities
mergeCollection
Method to merge a collection of Rules.
mergeCollection(mixed input) : void
since |
1.7.0 |
---|
Arguments
- input
mixed
Rule or array of Rules