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

Class: LiveUser_Admin_Perm_Simple

Source Location: /LiveUser_Admin-0.3.3/Perm/Simple.php

Class Overview


Simple permission administration class


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2002-2005 Markus Wolff

Variables

Methods


Child classes:

LiveUser_Admin_Perm_Medium
Medium container for permission handling

Inherited Variables

Inherited Methods


Class Details

[line 83]
Simple permission administration class

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 ]


Class Variables

$selectable_tables = array(
        'getUsers' => array('perm_users', 'userrights', 'rights'),'getRights'=>array('rights','userrights','translations','areas','applications'),'getAreas'=>array('areas','applications','translations'),'getApplications'=>array('applications','translations'),'getTranslations'=>array('translations'),)

[line 101]


Type:   mixed


[ Top ]

$withFieldMethodMap = array(
        'perm_user_id' => 'getUsers',
        'right_id' => 'getRights',
        'area_id' => 'getAreas',
        'application_id' => 'getApplications',
    )

[line 109]


Type:   mixed


[ Top ]



Method Detail

LiveUser_Admin_Perm_Simple (Constructor)   [line 119]

LiveUser_Admin_Perm_Simple LiveUser_Admin_Perm_Simple( )

Class constructor. Feel free to override in backend subclasses.

[ Top ]

addApplication   [line 399]

void addApplication( array $data)

Add application
  • Access: public

Parameters:

array   $data   — 

[ Top ]

addArea   [line 293]

void addArea( array $data)

Add area
  • Access: public

Parameters:

array   $data   — 

[ Top ]

addRight   [line 232]

void addRight( array $data)

Add right
  • Access: public

Parameters:

array   $data   — 

[ Top ]

addTranslation   [line 530]

void addTranslation( array $data)

Add translation
  • Access: public

Parameters:

array   $data   — 

[ Top ]

addUser   [line 167]

void addUser( array $data)

Add user
  • Access: public

Parameters:

array   $data   — 

[ Top ]

disconnect   [line 920]

void disconnect( )

properly disconnect from resources
  • Access: public

[ Top ]

getApplications   [line 718]

void getApplications( [array $params = array()])

Fetches applications
  • Access: public

Parameters:

array   $params   — 

[ Top ]

getAreas   [line 703]

void getAreas( [array $params = array()])

Fetches areas
  • Access: public

Parameters:

array   $params   — 

[ Top ]

getCurrentApplication   [line 385]

string getCurrentApplication( )

Get current application
  • Return: name of the current application
  • Access: public

[ Top ]

getRights   [line 686]

void getRights( [array $params = array()])

Fetches rights
  • Access: public

Overridden in child classes as:

LiveUser_Admin_Perm_Complex::getRights()
Fetches rights

Parameters:

array   $params   — 

[ Top ]

getTranslations   [line 735]

void getTranslations( [array $params = array()])

Fetches translations
  • Access: public

Parameters:

array   $params   — 

[ Top ]

getUsers   [line 669]

void getUsers( [array $params = array()])

Fetches users
  • Access: public

Parameters:

array   $params   — 

[ Top ]

grantUserRight   [line 460]

void grantUserRight( array $data)

Grant user a right
  • Access: public

Parameters:

array   $data   — 

[ Top ]

init   [line 131]

boolean init( mixed &$conf)

Load the storage container
  • Return: true on success or false on failure
  • Access: public

Parameters:

mixed   &$conf   —  Name of array containing the configuration.

[ Top ]

outputRightsConstants   [line 769]

mixed outputRightsConstants( string $type, [array $options = array()], [string $mode = null])

Generate the constants to a file or define them directly.

$mode can be either 'file' or 'php'. File will write the constant in the given file, replacing/adding constants as needed. Php will call define() function to actually define the constants.

$options can contain 'prefix' => 'prefix_goes_here', 'area' => 'specific area id to grab rights from', 'application' => 'specific application id to grab rights from' 'naming' => LIVEUSER_SECTION_RIGHT for PREFIX_RIGHTNAME <- DEFAULT LIVEUSER_SECTION_AREA for PREFIX_AREANAME_RIGHTNAME LIVEUSER_SECTION_APPLICATION for PREFIX_APPLICATIONNAME_AREANAME_RIGHTNAME 'filename' => if $mode is file you must give the full path for the output file

If not prefix is given it will not be used to generate the constants

  • Return: boolean, array or DB Error object
  • Access: public

Parameters:

string   $type   —  type of output (constant or array)
array   $options   —  options for constants generation
string   $mode   —  output mode desired (file or direct)

[ Top ]

removeApplication   [line 434]

void removeApplication( array $filters)

Remove application(s)
  • Access: public
  • Uses: LiveUser_Admin_Perm_Simple::removeArea

Parameters:

array   $filters   —  Array containing the filters on what application(s) should be removed

[ Top ]

removeArea   [line 344]

void removeArea( array $filters)

Removes all areas define in the filter as well as any rights assigned to that area.

  1.   $filters = array(
  2.       'area_id' => '34'
  3.   );
  4.   $foo $admin->perm->removeArea($filters);

Or you can also remove by any other field like so

  1.   $filters = array(
  2.       'area_define_name' => 'area232'
  3.   );
  4.   $foo $admin->perm->removeArea($filters);

  • Access: public
  • Uses: LiveUser_Admin_Perm_Simple::removeRight

Overridden in child classes as:

LiveUser_Admin_Perm_Complex::removeArea()
Remove Area

Parameters:

array   $filters   —  Array containing the filters on what area(s) should be removed

[ Top ]

removeRight   [line 267]

void removeRight( array $filters)

Remove right
  • Access: public
  • Uses: LiveUser_Admin_Perm_Simple::revokeUserRight

Overridden in child classes as:

LiveUser_Admin_Perm_Medium::removeRight()
Removes right(s)
LiveUser_Admin_Perm_Complex::removeRight()
Remove Right

Parameters:

array   $filters   —  Array containing the filters on what right(s) should be removed

[ Top ]

removeTranslation   [line 563]

void removeTranslation( array $filters)

Remove translation(s)
  • Access: public

Parameters:

array   $filters   —  Array containing the filters on what tranlation(s) should be removed

[ Top ]

removeUser   [line 206]

void removeUser( array $filters)

Remove user
  • Access: public
  • Uses: LiveUser_Admin_Perm_Simple::revokeUserRight

Overridden in child classes as:

LiveUser_Admin_Perm_Medium::removeUser()
Removes user(s)
LiveUser_Admin_Perm_Complex::removeUser()
Remove User

Parameters:

array   $filters   —  Array containing the filters on what user(s) should be removed

[ Top ]

revokeUserRight   [line 514]

void revokeUserRight( array $filters)

Revoke (remove) right(s) from the user(s)
  • Access: public

Parameters:

array   $filters   —  Array containing the filters on what right(s) should be removed from what user(s)

[ Top ]

setCurrentApplication   [line 370]

boolean setCurrentApplication( integer $applicationId)

Set current application
  • Return: always true
  • Access: public

Parameters:

integer   $applicationId   —  id of application

[ Top ]

updateApplication   [line 416]

void updateApplication( array $data, array $filters)

Update application(s)
  • Access: public

Parameters:

array   $data   — 
array   $filters   — 

[ Top ]

updateArea   [line 310]

void updateArea( array $data, array $filters)

Update area(s)
  • Access: public

Parameters:

array   $data   — 
array   $filters   — 

[ Top ]

updateRight   [line 249]

void updateRight( array $data, array $filters)

Update right
  • Access: public

Parameters:

array   $data   — 
array   $filters   — 

[ Top ]

updateTranslation   [line 547]

void updateTranslation( array $data, array $filters)

Update translation(s)
  • Access: public

Parameters:

array   $data   — 
array   $filters   — 

[ Top ]

updateUser   [line 188]

void updateUser( array $data, array $filters)

Update usr
  • Access: public

Parameters:

array   $data   — 
array   $filters   — 

[ Top ]

updateUserRight   [line 497]

void updateUserRight( array $data, array $filters)

Update right(s) for the given user(s)
  • Access: public

Parameters:

array   $data   — 
array   $filters   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:16:44 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.