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

Class: LiveUser_Admin_Perm_Complex

Source Location: /LiveUser_Admin-0.3.7/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-2005 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 278]

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 621]

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) 'subgroups' - defaults to false If subgroups should be included, if false then it acts same as the medium container getGroups, if set to true it will return all subgroups like they are directly assigned, if set to 'hierarchy' it will place a tree of the subgroups under the array key 'subgroups'

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 566]

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 815]

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

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

Overrides LiveUser_Admin_Perm_Medium::getRights() (Fetches rights)

Parameters:

bool   1   —  determines if joins should be done using the 'userrights' (default) or through the 'grouprights' and 'groupusers' tables
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) 'by_group' - if joins should be done using the 'userrights' (false default) or through the 'grouprights' and 'groupusers' tables (true)

[ Top ]

implyRight   [line 190]

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 362]

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 340]

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 482]

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 391]

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 175]

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 250]

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 Mon, 11 Mar 2019 14:36:50 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.