LiveUser_Admin
[ class tree: LiveUser_Admin ] [ index: LiveUser_Admin ] [ all elements ]

Class: LiveUser_Admin_Perm_Medium

Source Location: /LiveUser_Admin-0.4.0/Perm/Medium.php

Class Overview

LiveUser_Admin_Perm_Simple
   |
   --LiveUser_Admin_Perm_Medium

Medium permission administration class that extends the Simple class with the ability to create, update, remove and assign groups.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2002-2006 Markus Wolff

Methods


Child classes:

LiveUser_Admin_Perm_Complex
Complex permission administration class that extends the Medium class with the ability to manage subgroups, implied rights and area admins

Inherited Variables

Inherited Methods

Class: LiveUser_Admin_Perm_Simple

LiveUser_Admin_Perm_Simple::LiveUser_Admin_Perm_Simple()
Constructor
LiveUser_Admin_Perm_Simple::addApplication()
Add an application
LiveUser_Admin_Perm_Simple::addArea()
Add an area
LiveUser_Admin_Perm_Simple::addRight()
Add a right
LiveUser_Admin_Perm_Simple::addTranslation()
Add a translation
LiveUser_Admin_Perm_Simple::addUser()
Add a user
LiveUser_Admin_Perm_Simple::disconnect()
properly disconnect from resources
LiveUser_Admin_Perm_Simple::getApplications()
Fetches applications
LiveUser_Admin_Perm_Simple::getAreas()
Fetches areas
LiveUser_Admin_Perm_Simple::getRights()
Fetches rights
LiveUser_Admin_Perm_Simple::getTranslations()
Fetches translations
LiveUser_Admin_Perm_Simple::getUsers()
Fetches users
LiveUser_Admin_Perm_Simple::grantUserRight()
Grant user a right
LiveUser_Admin_Perm_Simple::init()
Initialize the storage container
LiveUser_Admin_Perm_Simple::outputRightsConstants()
Generate the constants to a file or define them directly.
LiveUser_Admin_Perm_Simple::removeApplication()
Remove applications and all their relevant relations
LiveUser_Admin_Perm_Simple::removeArea()
Remove areas and all their relevant relations
LiveUser_Admin_Perm_Simple::removeRight()
Remove rights and all their relevant relations
LiveUser_Admin_Perm_Simple::removeTranslation()
Remove translations and all their relevant relations
LiveUser_Admin_Perm_Simple::removeUser()
Remove users and all their relevant relations
LiveUser_Admin_Perm_Simple::revokeUserRight()
Revoke (remove) right(s) from the user(s)
LiveUser_Admin_Perm_Simple::updateApplication()
Update applications
LiveUser_Admin_Perm_Simple::updateArea()
Update areas
LiveUser_Admin_Perm_Simple::updateRight()
Update rights
LiveUser_Admin_Perm_Simple::updateTranslation()
Update translations
LiveUser_Admin_Perm_Simple::updateUser()
Update users
LiveUser_Admin_Perm_Simple::updateUserRight()
Update right(s) for the given user(s)

Class Details

[line 91]
Medium permission administration class that extends the Simple class with the ability to create, update, remove and assign groups.

This class provides a set of functions for implementing a user permission management system on live websites. All authorisation backends/containers must be extensions of this base class.



[ Top ]


Method Detail

LiveUser_Admin_Perm_Medium (Constructor)   [line 100]

void LiveUser_Admin_Perm_Medium( )

Constructor
  • Access: protected

[ Top ]

addGroup   [line 118]

int|bool addGroup( array $data)

Add a group
  • Return: false on error, true (or new id) on success
  • Access: public

Parameters:

array   $data   —  containing atleast the key-value-pairs of all required columns in the group table

[ Top ]

addUserToGroup   [line 275]

void addUserToGroup( array $data)

Add a user to agroup
  • Access: public

Parameters:

array   $data   —  containing the perm_user_id and group_id

[ Top ]

getGroups   [line 453]

bool|array getGroups( [array $params = array()])

Fetches groups
  • Return: false on failure or array with selected data
  • Access: public

Overridden in child classes as:

LiveUser_Admin_Perm_Complex::getGroups()
Fetches groups

Parameters:

array   $params   —  containing key-value pairs for: 'fields' - ordered array containing the fields to fetch if empty all fields from the user table are fetched 'filters' - key values pairs (value may be a string or an array) 'orders' - key value pairs (values 'ASC' or 'DESC') 'rekey' - if set to true, returned array will have the first column as its first dimension 'group' - if set to true and $rekey is set to true, then all values with the same first column will be wrapped in an array 'limit' - number of rows to select 'offset' - first row to select 'select' - determines what query method to use: 'one' -> queryOne, 'row' -> queryRow, 'col' -> queryCol, 'all' ->queryAll (default) 'selectable_tables' - array list of tables that may be joined to in this query, the first element is the root table from which the joins are done

[ Top ]

getRights   [line 341]

bool|array getRights( [array $params = array()])

Fetches rights
  • Return: false on failure or array with selected data
  • Access: public

Overridden in child classes as:

LiveUser_Admin_Perm_Complex::getRights()
Fetches rights

Overrides LiveUser_Admin_Perm_Simple::getRights() (Fetches rights)

Parameters:

array   $params   —  containing key-value pairs for: 'fields' - ordered array containing the fields to fetch if empty all fields from the user table are fetched 'filters' - key values pairs (value may be a string or an array) 'orders' - key value pairs (values 'ASC' or 'DESC') 'rekey' - if set to true, returned array will have the first column as its first dimension 'group' - if set to true and $rekey is set to true, then all values with the same first column will be wrapped in an array 'limit' - number of rows to select 'offset' - first row to select 'select' - determines what query method to use: 'one' -> queryOne, 'row' -> queryRow, 'col' -> queryCol, 'all' ->queryAll (default) 'selectable_tables' - array list of tables that may be joined to in this query, the first element is the root table from which the joins are done 'by_group' - if joins should be done using the 'userrights' (false default) or through the 'grouprights' and 'groupusers' tables (true)

[ Top ]

grantGroupRight   [line 200]

void grantGroupRight( array $data)

Grant group a right

  1.  // grant user id 13 the right NEWS_CHANGE
  2.  $data = array(
  3.       'right_id'     => NEWS_CHANGE,
  4.       'group_id' => 13
  5.  );
  6.  $lua->perm->grantGroupRight($data);

  • Access: public

Parameters:

array   $data   —  containing the group_id and right_id and optionally a right_level

[ Top ]

removeGroup   [line 155]

int|bool removeGroup( array $filters)

Remove groups and all their relevant relations
  • Return: false on error, the affected rows on success
  • Access: public

Overridden in child classes as:

LiveUser_Admin_Perm_Complex::removeGroup()
Remove groups and all their relevant relations

Parameters:

array   $filters   —  key values pairs (value may be a string or an array) This will construct the WHERE clause of your update Be careful, if you leave this blank no WHERE clause will be used and all groups will be affected by the removed

[ Top ]

removeRight   [line 381]

int|bool removeRight( array $filters)

Remove rights and all their relevant relations
  • Return: false on error, the affected rows on success
  • Access: public

Overridden in child classes as:

LiveUser_Admin_Perm_Complex::removeRight()
Remove rights and all their relevant relations

Overrides LiveUser_Admin_Perm_Simple::removeRight() (Remove rights and all their relevant relations)

Parameters:

array   $filters   —  key values pairs (value may be a string or an array) This will construct the WHERE clause of your update Be careful, if you leave this blank no WHERE clause will be used and all rights will be affected by the remove

[ Top ]

removeUser   [line 407]

int|bool removeUser( array $filters)

Remove users and all their relevant relations
  • Return: false on error, the affected rows on success
  • Access: public

Overrides LiveUser_Admin_Perm_Simple::removeUser() (Remove users and all their relevant relations)

Parameters:

array   $filters   —  key values pairs (value may be a string or an array) This will construct the WHERE clause of your update Be careful, if you leave this blank no WHERE clause will be used and all users will be affected by the removed

[ Top ]

removeUserFromGroup   [line 306]

int|bool removeUserFromGroup( array $filters)

Remove user(s) from group(s)
  • Return: false on error, the affected rows on success
  • Access: public

Parameters:

array   $filters   —  key values pairs (value may be a string or an array) This will construct the WHERE clause of your update Be careful, if you leave this blank no WHERE clause will be used and all users will be affected by the remove

[ Top ]

revokeGroupRight   [line 260]

int|bool revokeGroupRight( array $filters)

Revoke (remove) right(s) from the group(s)
  • Return: false on error, the affected rows on success
  • Access: public

Parameters:

array   $filters   —  key values pairs (value may be a string or an array) This will construct the WHERE clause of your update Be careful, if you leave this blank no WHERE clause will be used and all groups will be affected by the remove

[ Top ]

updateGroup   [line 137]

int|bool updateGroup( array $data, array $filters)

Update groups
  • Return: false on error, the affected rows on success
  • Access: public

Parameters:

array   $data   —  containing the key value pairs of columns to update
array   $filters   —  key values pairs (value may be a string or an array) This will construct the WHERE clause of your update Be careful, if you leave this blank no WHERE clause will be used and all groups will be affected by the update

[ Top ]

updateGroupRight   [line 242]

int|bool updateGroupRight( array $data, array $filters)

Update right(s) for the given group(s)
  • Return: false on error, the affected rows on success
  • Access: public

Parameters:

array   $data   —  containing the key value pairs of columns to update
array   $filters   —  key values pairs (value may be a string or an array) This will construct the WHERE clause of your update Be careful, if you leave this blank no WHERE clause will be used and all groups will be affected by the update

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:39:43 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.