API16

JRules/allow: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Checks that an action can be performed by an identity. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JRules/allow|Edit Descripton...
 
m clean up
Line 2: Line 2:
Checks that an action can be performed by an identity.
Checks that an action can be performed by an identity.


<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JRules/allow|Edit Descripton]]<nowiki>]</nowiki>
</span>


{{Description:JRules/allow}}
 
{{subst:Description:JRules/allow}}


===Syntax===
===Syntax===
Line 49: Line 47:
</source>
</source>


<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JRules/allow|Edit See Also]]<nowiki>]</nowiki>
{{subst:SeeAlso:JRules/allow}}
</span>
{{SeeAlso:JRules/allow}}


===Examples===
===Examples===

Revision as of 14:22, 24 March 2017

Description

Checks that an action can be performed by an identity.


{{subst:Description:JRules/allow}}

Syntax

allow($action, $identity)
Parameter Name Default Value Description
$action The name of the action.
$identity An integer representing the identity, or an array of identities

Returns

mixed

Defined in

libraries/joomla/access/rules.php

Importing

jimport( 'joomla.access.rules' );

Source Body

public function allow($action, $identity)
{
// TODO: Remove debug when finished testing.
//echo "<br>Action: $action, ".print_r($identity, 1);
        // Check we have information about this action.
        if (isset($this->_data[$action])) {
//print_r($this->_data[$action]);
                return $this->_data[$action]->allow($identity);
        }
        return null;
}


{{subst:SeeAlso:JRules/allow}}

Examples

<CodeExamplesForm />