Index
The privilege manager
TIP uses different security levels, defined in a top-down fashion: every level allows the actions of the lower levels.
Here's the privilege list, ordered from the highest to the lowest level:
* admin: can perform actionDelete() on everything
* trusted: can perform actionEdit() and actionDelete() on his owned content
* untrusted: can perform actionAdd()
* none: can perform actionView() and actionBrowse()
For addictive actions, such as actionLogin() and actionLogout() in TIP_User, you can directy check the source of the module.
The privileges are stored in a "Module-User" way, so for every pair of module-user there will be a specific privilege level. If a requested module-user pair is not stored in the privilege database, the default privilege level will be used.
The default privileges SHOULD be specified in the config file for every module in the 'default_privilege' and 'anonymous_privilege' options. If not specified, the privilege defaults to the one of the application module.
Constructor
Initializes a TIP_Privilege instance.
Custom post construction method
Overrides the default post-constructor method to avoid the TIP::getPrivilege() call and the consequential mutual recursion.
Check if the current user is manager
Expands to 'true' if the current logged-in user is manager in the module specified with $params, 'false' otherwise.
Check if the current user is administrator
Expands to 'true' if the current logged-in user is administrator in the module specified with $params, 'false' otherwise.
Check if the current user is a trusted user ' Expands to 'true' if the current logged-in user is trusted in the module specified with $params, 'false' otherwise.
Check if the current user is an untrusted user
Expands to 'true' if the current logged-in user is untrusted in the module specified with $params, 'false' otherwise.
Get the privilege description
Expands to the specified privilege description, in the current locale. In $params you must specify the privilege as 'module_id,privilege', where privilege must be manager|admin|trusted|untrusted|none.
Get the privilege id from a privilege level
Given a privilege level (1..5), returns the privilege id, that is a string containing manager|admin|trusted|untrusted|none.
Get the privilege level from a privilege id
The reverse operation of tagPrivilegeId().
Perform a change action
Changes the privilege level for the given user on the specified module.
TIP_Privilegewas last modified by TiP on Mon 25 May 2009 06:22:25 PM CEST