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

Class: LiveUser_Admin_Perm_Complex

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

Class Overview

LiveUser_Admin_Perm_Simple
   |
   --LiveUser_Admin_Perm_Medium
      |
      --LiveUser_Admin_Perm_Complex

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


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2002-2006 Markus Wolff

Methods


Inherited Variables

Inherited Methods

Class: LiveUser_Admin_Perm_Medium

LiveUser_Admin_Perm_Medium::LiveUser_Admin_Perm_Medium()
Constructor
LiveUser_Admin_Perm_Medium::addGroup()
Add a group
LiveUser_Admin_Perm_Medium::addUserToGroup()
Add a user to agroup
LiveUser_Admin_Perm_Medium::getGroups()
Fetches groups
LiveUser_Admin_Perm_Medium::getRights()
Fetches rights
LiveUser_Admin_Perm_Medium::grantGroupRight()
Grant group a right
LiveUser_Admin_Perm_Medium::removeGroup()
Remove groups and all their relevant relations
LiveUser_Admin_Perm_Medium::removeRight()
Remove rights and all their relevant relations
LiveUser_Admin_Perm_Medium::removeUser()
Remove users and all their relevant relations
LiveUser_Admin_Perm_Medium::removeUserFromGroup()
Remove user(s) from group(s)
LiveUser_Admin_Perm_Medium::revokeGroupRight()
Revoke (remove) right(s) from the group(s)
LiveUser_Admin_Perm_Medium::updateGroup()
Update groups
LiveUser_Admin_Perm_Medium::updateGroupRight()
Update right(s) for the given group(s)

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 88]
Complex permission administration class that extends the Medium class with the ability to manage subgroups, implied rights and area admins

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_Complex (Constructor)   [line 97]

void LiveUser_Admin_Perm_Complex( )

Constructor
  • Access: protected

[ Top ]

addAreaAdmin   [line 294]

bool addAreaAdmin( array $data)

Add Area Admin
  • Return: false on error, true on success
  • Access: public

Parameters:

array   $data     containing the area_id and perm_user_id

[ Top ]

assignSubGroup   [line 127]

bool assignSubGroup( array $data)

Assign subgroup to parent group.

First checks if groupId and subgroupId are the same then if the child group is already assigned to the parent group and last if the child group does have a parent group already assigned to it. (Just to difference between what kinda error was hit)

If so it returns false and pushes the error into stack.

The expected parameter array is of the form

  1.  $lua->perm->assignSubGroup(
  2.      array('group_id' => 'id''subgroup_id' => 'id')
  3.  );

  • Return: false on error, true on success
  • Access: public

Parameters:

array   $data     containing the subgroup_id and group_id

[ Top ]

getGroups   [line 638]

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

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

Overrides LiveUser_Admin_Perm_Medium::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 'subgroups' - filter array if all subgroups should be 'hierarchy' - filter array if all subgroups should be

note that 'hierarchy' requires 'rekey' enabled, 'group' is disabled, 'select' set to 'all' and the first field needs to be 'group_id'


[ Top ]

getParentGroup   [line 589]

bool|int getParentGroup( Id $subGroupId)

Get parent of a subgroup
  • Return: false on failure or integer with the parent group_id
  • Access: public

Parameters:

Id   $subGroupId     of the subgroup_id that is used to fetch the parent

[ Top ]

getRights   [line 889]

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

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

Overrides LiveUser_Admin_Perm_Medium::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) 'inherited' - filter array to fetch all rughts from 'implied' - filter array for fetching implied rights 'hierarchy' - filter array for fetching implied rights

[ Top ]

implyRight   [line 189]

bool implyRight( array $data)

Imply Right
  • Return: false on error, true on success
  • Access: public

Parameters:

array   $data     containing the implied_right_id and right_id

[ Top ]

removeArea   [line 366]

int|bool removeArea( array $filters)

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

Overrides LiveUser_Admin_Perm_Simple::removeArea() (Remove areas 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 areas will be affected by the remove

[ Top ]

removeAreaAdmin   [line 343]

int|bool removeAreaAdmin( array $filters)

Remove Area Admin(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 ]

removeGroup   [line 494]

int|bool removeGroup( array $filters)

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

Overrides LiveUser_Admin_Perm_Medium::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 398]

int|bool removeRight( array $filters)

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

Overrides LiveUser_Admin_Perm_Medium::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 ]

unassignSubGroup   [line 173]

int|bool unassignSubGroup( array $filters)

Unassign subgroup(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 groups will be affected by the remove

[ Top ]

unimplyRight   [line 255]

int|bool unimplyRight( array $filters, [bool $update = true])

Unimply right(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
bool   $update     determines if the implied rights field in the rights table should be updated or not

[ Top ]


Documentation generated on Tue, 05 Oct 2010 16:30:07 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.