PostNuke Help |
||
|---|---|---|
Previous |
Next |
|
authorise attempted action
bool pnSecAuthAction(realm, component, instance, level, uid(opt));
pnSecAuthAction() checks against the authorisation information held within the PostNuke system to decide if a particular level of authorisation can be allowed.
The realm that this authorisation is taking place in; currently always 0
The component for which this authorisation is taking place
The instance for which this authorisation is taking place
The level of access which this authorisation requires to be allowed
The uid of the user to check for authorisation
This function returns true if the level of authorisation granted to the user for the given arguments is greater than or equal to the required level, false if the level of authorisation granted to the user for the given arguments is less than the required level. This function returns void if an exception was raised.
This function raises DATABASE_ERROR if an error occurs while querying data.
A full description of the PostNuke authorisation system is beyond the scope of this document. For more in formation on the authorisation system and its use of realms, components, and instances, please refer to the PostNuke Authorisation System documentation.
This function was previously known as authorised(). That name is deprecated but still functional in this version of the PostNuke API; it is recommended that any calls that are currently made to authorised() are changed to pnSecAuthAction().
// See if use is authorised to access 'foo' module admin functions
if (pnSecAuthAction(0,
'Foo::',
'My Foo:Foos of the world:4',
ACCESS_ADMIN)) {
// Yes
} else {
// No
}
Previous |
Next |