Back to Rules class

Method allow

public mixed
allow
(mixed $action, mixed $identity)
Checks that an action can be performed by an identity.
Parameters
  • string $action The name of the action.
  • mixed $identity An integer representing the identity, or an array of identities
Returns
  • mixed Object or null if there is no information about the action.
Since
  • 1.7.0
Class: Rules
Project: Joomla

Method allow - Source code

/**
 * Checks that an action can be performed by an identity.
 *
 * The identity is an integer where +ve represents a user group,
 * and -ve represents a user.
 *
 * @param   string  $action    The name of the action.
 * @param   mixed   $identity  An integer representing the identity, or an array of identities
 *
 * @return  mixed   Object or null if there is no information about the action.
 *
 * @since   1.7.0
 */
public function allow($action, $identity)
{
    // Check we have information about this action.
    if (isset($this->data[$action])) {
        return $this->data[$action]->allow($identity);
    }
}