Returns the short name of an object, the last portion of the full name.
static string
getShortName
(string $name)
-
string
$name: The name of the object.
Adds a permission to the permissions system. The permission must first be created with Perm::newPermission(), and have any initial users added to it, before this function is called.
void
addPermission
( &$perm, Permission $perm)
-
Permission
$perm: The new perm object.
-
&$perm
Redefined in descendants as:
-
Perms_datatree::addPermission()
: Adds a permission to the permissions system. The permission must first be created with Perm::newPermission(), and have any initial users added to it, before this function is called.
-
Perms_sql::addPermission()
: Adds a permission to the permissions system. The permission must first be created with Perm::newPermission(), and have any initial users added to it, before this function is called.
Checks if a permission exists in the system.
boolean
exists
(string $permission)
-
string
$permission: The permission to check.
Redefined in descendants as:
Attempts to return a concrete Perms instance based on $driver.
Perms|boolean
&factory
([
string $driver =
null], [
array $params =
null])
-
string
$driver: The type of the concrete Perms subclass to return. The class name is based on the perms driver ($driver). The code is dynamically included.
-
array
$params: A hash containing any additional configuration or connection parameters a subclass might need.
Returns information about permissions implemented by an application.
array
getApplicationPermissions
(string $app)
-
string
$app: An application name.
Returns the available permissions for a given level.
array
getAvailable
(string $name)
-
string
$name: The permission's name.
Returns a list of parent permissions.
array
getParents
(string $child)
-
string
$child: The name of the child to retrieve parents for.
Redefined in descendants as:
Returns a Permission object corresponding to the named permission, with the users and other data retrieved appropriately.
void
&getPermission
(string $name)
-
string
$name: The name of the permission to retrieve.
Redefined in descendants as:
-
Perms_datatree::getPermission()
: Returns a DataTreeObject_Permission object corresponding to the named permission, with the users and other data retrieved appropriately.
-
Perms_sql::getPermission()
: Returns a SQLObject_Permission object corresponding to the named permission, with the users and other data retrieved appropriately.
Returns a Permission object corresponding to the given unique ID, with the users and other data retrieved appropriately.
void
&getPermissionById
(integer $cid)
-
integer
$cid: The unique ID of the permission to retrieve.
Redefined in descendants as:
-
Perms_datatree::getPermissionById()
: Returns a DataTreeObject_Permission object corresponding to the given unique ID, with the users and other data retrieved appropriately.
-
Perms_sql::getPermissionById()
: Returns a SQLObject_Permission object corresponding to the given unique ID, with the users and other data retrieved appropriately.
Returns the unique identifier of this permission.
integer
getPermissionId
(Permission $permission)
-
Permission
$permission: The permission object to get the ID of.
Redefined in descendants as:
Finds out what rights the given user has to this object.
mixed
getPermissions
(mixed $permission, [string $user = null], [string $creator = null])
-
mixed
$permission: The full permission name of the object to check the permissions of, or the Permission object.
-
string
$user: The user to check for. Defaults to the current user.
-
string
$creator: The user who created the event.
Returns an hash of the available permissions.
array
getPermsArray
()
Given a permission name, returns the title for that permission by looking it up in the applications's permission api.
string
getTitle
(string $name)
-
string
$name: The permissions's name.
Returns all permissions of the system in a tree format.
array
getTree
()
Redefined in descendants as:
Finds out if the user has the specified rights to the given object.
boolean
hasPermission
(string $permission, string $user, integer $perm, [string $creator = null])
-
string
$permission: The permission to check.
-
string
$user: The user to check for.
-
integer
$perm: The permission level that needs to be checked for.
-
string
$creator: The creator of the event
Given an integer value of permissions returns an array representation of the integer.
void
integerToArray
(integer $int)
-
integer
$int: The integer representation of permissions.
Returns a new permissions object.
Permissions
&newPermission
(string $name)
-
string
$name: The permission's name.
Redefined in descendants as:
Removes a permission from the permissions system permanently.
void
removePermission
( &$perm, [boolean $force = false], Permission $perm)
-
Permission
$perm: The permission to remove.
-
boolean
$force: Force to remove every child.
-
&$perm
Redefined in descendants as:
Attempts to return a reference to a concrete Perms instance.
It will only create a new instance if no Perms instance currently exists.
This method must be invoked as: $var = &Perms::singleton()
Perms|boolean
&singleton
()