Inheritance diagram for UserGroup:
Collaboration diagram for UserGroup:Public Member Functions | |
| __construct ($paramarray=array()) | |
| insert () | |
| update () | |
| delete () | |
| __get ($param) | |
| add ($users) | |
| remove ($users) | |
| grant ($tokens, $access= 'full') | |
| deny ($tokens) | |
| revoke ($tokens) | |
| can ($token, $access= 'full') | |
| get_access ($token) | |
| clear_permissions_cache () | |
| load_permissions_cache () | |
| member ($user_id) | |
Static Public Member Functions | |
| static | default_fields () |
| static | create ($paramarray) |
| static | get ($group) |
| static | get_by_id ($id) |
| static | get_by_name ($name) |
| static | exists ($group) |
| static | name ($id) |
| static | id ($name) |
Protected Member Functions | |
| set_member_list () | |
| load_member_cache ($refresh=false) | |
Definition at line 11 of file usergroup.php.
| UserGroup::__construct | ( | $ | paramarray = array() |
) |
Constructor for the UserGroup class
| array | $paramarray an associative array of UserGroup fields |
Reimplemented from QueryRecord.
Definition at line 34 of file usergroup.php.
| UserGroup::__get | ( | $ | param | ) |
function __get magic get function for returning virtual properties of the class
| mixed | the property to get |
Reimplemented from QueryRecord.
Definition at line 164 of file usergroup.php.
| UserGroup::add | ( | $ | users | ) |
Add one or more users to this group
| mixed | $users a user ID or name, or an array of the same |
Definition at line 192 of file usergroup.php.
| UserGroup::can | ( | $ | token, | |
| $ | access = 'full' | |||
| ) |
Determine whether members of a group can do something. This function should not be used to determine composite permissions among several groups
| mixed | a permission ID or name |
Definition at line 271 of file usergroup.php.
| UserGroup::clear_permissions_cache | ( | ) |
Clear permissions cache.
Definition at line 300 of file usergroup.php.
| static UserGroup::create | ( | $ | paramarray | ) | [static] |
Create a new UserGroup object and save it to the database
| array | $paramarray An associative array of UserGroup fields |
Definition at line 52 of file usergroup.php.
Referenced by ACL::rebuild_permissions(), and AdminGroupsHandler::update_groups().
| static UserGroup::default_fields | ( | ) | [static] |
get default fields for this record
Definition at line 22 of file usergroup.php.
Referenced by UserGroups::get().
| UserGroup::delete | ( | ) |
| UserGroup::deny | ( | $ | tokens | ) |
Deny one or more permission tokens to this group
| mixed | The permission ID or name to be denied, or an array of the same |
Definition at line 244 of file usergroup.php.
| static UserGroup::exists | ( | $ | group | ) | [static] |
Determine whether a group exists
| mixed | The name or ID of the group |
Definition at line 361 of file usergroup.php.
Referenced by User::insert(), and AdminGroupsHandler::update_groups().
| static UserGroup::get | ( | $ | group | ) | [static] |
Fetch a group from the database by ID or name. This is a wrapper for get_by_id() and get_by_name()
| mixed | $group A group ID or name |
Definition at line 326 of file usergroup.php.
Referenced by ACL::create_token(), and member().
| UserGroup::get_access | ( | $ | token | ) |
Return the access bitmask for a specific token for this group.
| string | $token The |
Definition at line 287 of file usergroup.php.
| static UserGroup::get_by_id | ( | $ | id | ) | [static] |
Select a group from the DB by its ID
| int | A group ID |
Definition at line 341 of file usergroup.php.
Referenced by AdminGroupsHandler::ajax_groups(), get(), AdminGroupsHandler::get_group(), ACL::grant_group(), AdminGroupsHandler::post_group(), ACL::revoke_group_token(), and AdminGroupsHandler::update_groups().
| static UserGroup::get_by_name | ( | $ | name | ) | [static] |
Select a group from the DB by its name
| string | A group name |
Definition at line 351 of file usergroup.php.
Referenced by create(), get(), and ACL::rebuild_permissions().
| UserGroup::grant | ( | $ | tokens, | |
| $ | access = 'full' | |||
| ) |
Assign one or more new permission tokens to this group
| mixed | A permission token ID, name, or array of the same |
Definition at line 228 of file usergroup.php.
Referenced by deny().
| static UserGroup::id | ( | $ | name | ) | [static] |
Given a group's name, return its ID
| string | a group's name |
Definition at line 383 of file usergroup.php.
Referenced by ACL::get_group_token_access(), and User::in_group().
| UserGroup::insert | ( | ) |
Save a new UserGroup to the UserGroup table
Reimplemented from QueryRecord.
Definition at line 73 of file usergroup.php.
| UserGroup::load_member_cache | ( | $ | refresh = false |
) | [protected] |
Cache the member ids that belong to this group
| boolean | $refresh Optional. If true, refresh the cache |
Definition at line 413 of file usergroup.php.
Referenced by __get(), add(), remove(), and set_member_list().
| UserGroup::load_permissions_cache | ( | ) |
Load permissions cache.
Definition at line 309 of file usergroup.php.
Referenced by __get(), can(), and get_access().
| UserGroup::member | ( | $ | user_id | ) |
Determine whether the specified user is a member of the group
| mixed | A user ID or name |
Definition at line 395 of file usergroup.php.
| static UserGroup::name | ( | $ | id | ) | [static] |
Given a group's ID, return its friendly name
| int | a group's ID |
Definition at line 371 of file usergroup.php.
Referenced by add(), insert(), remove(), set_member_list(), and update().
| UserGroup::remove | ( | $ | users | ) |
Remove one or more user from this group
| mixed | $users A user ID or name, or an array of the same |
Definition at line 211 of file usergroup.php.
| UserGroup::revoke | ( | $ | tokens | ) |
Remove one or more permissions from a group
| mixed | a permission ID, name, or array of the same |
Definition at line 253 of file usergroup.php.
| UserGroup::set_member_list | ( | ) | [protected] |
Set the member list for this group
Definition at line 120 of file usergroup.php.
| UserGroup::update | ( | ) |
Updates an existing UserGroup in the DB
Reimplemented from QueryRecord.
Definition at line 101 of file usergroup.php.
1.7.1