Class CMS_profile

Description

Class CMS_Profile

editing/viewing permissions for a user profile

Located in /automne/classes/user/profile.php (line 31)

CMS_grandFather
   |
   --CMS_profile
Direct descendents
Class Description
 class CMS_profile_user Class CMS_profile_user
 class CMS_profile_usersGroup Class CMS_profile_usersGroup
Class Constant Summary
Method Summary
 static array(integer=>integer) getAllAdminClearances ()
 static array(integer=>integer) getAllModuleCategoriesClearances ()
 static array(integer getAllModuleClearances ()
 static array(integer=>integer) getAllPageClearances ()
 static The getPageClearanceRoot (integer $pageId, [ $outputCMS_page = true])
 void __construct ([integer $id = 0])
 void addAdminClearance (integer $adminClearance)
 boolean addGroup (mixed $group)
 boolean addModuleCategoriesClearancesStack ( $clearances, CMS_stack $clearances,)
 void addModuleClearance (string $moduleCodename, integer $clearance, boolean $overwrite)
 void addModuleClearances (CMS_stack() $moduleClearances)
 void addPageClearance (integer $pageId, integer $clearance, boolean $overwrite)
 void addPageClearances (CMS_stack $pageClearances)
 void addRowGroupsDenied (CMS_stack() $rowGroupsDenied)
 void addTemplateGroupsDenied (CMS_stack() $templateGroupsDenied)
 void addValidationClearance (string $moduleCodename)
 void addValidationClearances (CMS_stack $validationClearances)
 void delModuleClearance ( $moduleCodename)
 void delPageClearance ( $pageid)
 void delValidationClearance ( $moduleCodename)
 void destroy ()
 array filterModuleCategoriesClearance ( $categories, [ $clearance = CLEARANCE_MODULE_VIEW], [string $module = false], [boolean $strict = false], array $categories,, integer $clearance,)
 integer getAdminClearance ()
 array(integer) getEditablePageClearanceRoots ()
 integer getId ()
 CMS_moduleCategoriesClearances getModuleCategoriesClearancesStack ([ $moduleCodename = false], string $moduleCodename,)
 CMS_stack() getModuleClearances ()
 CMS_stack() getPageClearances ()
 array(integer getRootCategories ([ $clearance = false], [ $module = false], [ $return_objects = false], [ $strict = true], integer $clearance,, string $module,, boolean $return_objects,, boolean $strict,)
 array(integer getRootModuleCategories ([ $module = false], [ $return_objects = false], string $module,, integer $clearance,, boolean $return_objects,)
 array(integer getRootModuleCategoriesDenied ([ $module = false], [ $return_objects = false], string $module,, boolean $return_objects,)
 array(integer getRootModuleCategoriesManagable ([ $module = false], [ $return_objects = false], string $module,, boolean $return_objects,)
 array(integer getRootModuleCategoriesReadable ([ $module = false], [ $return_objects = false], string $module,, boolean $return_objects,)
 array(integer getRootModuleCategoriesWritable ([ $module = false], [ $return_objects = false], string $module,, boolean $return_objects,)
 CMS_stack() getRowGroupsDenied ()
 CMS_stack() getTemplateGroupsDenied ()
 array(integer) getViewablePageClearanceRoots ()
 boolean hasAdminAccess (integer $clearance)
 boolean hasAdminClearance (integer $clearance)
 boolean hasEditableModules ()
 boolean hasEditablePages ()
 boolean hasModuleCategoryClearance ( $category_id, [ $clearance = CLEARANCE_MODULE_VIEW], [string $module = false], integer $category_id,, integer $clearance,)
 boolean hasModuleClearance (string $moduleCodename, integer $clearance)
 boolean hasPageClearance (integer $pageId, integer $clearance)
 boolean hasRowGroupsDenied (string $rowGroup)
 boolean hasTemplateGroupsDenied (string $templateGroup)
 boolean hasValidationClearance ([string $moduleCodename = false])
 boolean hasViewvablePages ()
 boolean resetClearances ()
 void setAdminClearance (integer $adminClearance)
 boolean setModuleCategoriesClearances ( $clearances, CMS_moduleCategoriesClearances $clearances,)
 boolean setModuleCategoriesClearancesStack ( $clearances, CMS_stack $clearances,)
 void setModuleClearances (CMS_stack() $moduleClearances)
 void setPageClearances (CMS_stack $pageClearances)
 void setRowGroupsDenied (CMS_stack() $rowGroupsDenied)
 void setTemplateGroupsDenied (CMS_stack() $templateGroupsDenied)
 void setValidationClearances (CMS_stack $validationClearances)
 boolean writeToPersistence ()
 void _addStackClearances ( $stack1,  $stack2, CMS_stack $pageClearances)
 void _filterModuleCategoriesClearanceRecursion ( $nLevelArray,  &$matchingCats,  &$deniedCats,  $fatherRights)
 boolean _hasClearance (CMS_stack $clearances, integer $id, integer $clearance)
Methods
static getAllAdminClearances (line 1538)

Returns array with translation key values for all admin clearance constants

  • access: public
static array(integer=>integer) getAllAdminClearances ()
static getAllModuleCategoriesClearances (line 1572)

Returns array with translation key values for all module level constants

  • access: public
static array(integer=>integer) getAllModuleCategoriesClearances ()
static getAllModuleClearances (line 1558)

Returns array with translation key values for all module level constants

  • return: clearance => array('label' => integer, 'description' => integer))
  • access: public
static array(integer getAllModuleClearances ()
static getAllPageClearances (line 1588)

Returns array with translation key values for all clearance page level constants

  • access: public
static array(integer=>integer) getAllPageClearances ()
static getPageClearanceRoot (line 542)

Get the page clearance root for a given page (this function must be as fast as possible because it is often used with APPLICATION_ENFORCES_ACCESS_CONTROL)

  • return: root page (CMS_page if $outputCMS_page is true, else pageID)
  • access: public
static The getPageClearanceRoot (integer $pageId, [ $outputCMS_page = true])
  • integer $pageId: The DB ID of the page we test
  • $outputCMS_page
Constructor __construct (line 148)

Constructor.

initializes the profile from the database if the id is given

  • access: public
void __construct ([integer $id = 0])
  • integer $id: if of profile

Redefined in descendants as:
addAdminClearance (line 277)

add Administration Clearance

  • access: public
void addAdminClearance (integer $adminClearance)
  • integer $adminClearance
addGroup (line 1064)

Add a given group to user

  • access: public
boolean addGroup (mixed $group)
  • mixed $group: : the group to add or the group id to add
addModuleCategoriesClearancesStack (line 1214)

Sets modules categories clearances from a stack

  • return: true on success
  • access: public
boolean addModuleCategoriesClearancesStack ( $clearances, CMS_stack $clearances,)
  • CMS_stack $clearances,: clearances to set
  • $clearances
addModuleClearance (line 700)

add Module Clearances

  • access: public
void addModuleClearance (string $moduleCodename, integer $clearance, boolean $overwrite)
  • string $moduleCodename
  • integer $clearance
  • boolean $overwrite: if true overwrites previous clearance if clearance exists
addModuleClearances (line 630)

add Module Clearances

  • access: public
void addModuleClearances (CMS_stack() $moduleClearances)
  • CMS_stack() $moduleClearances
addPageClearance (line 589)

add Page Clearances

  • access: public
void addPageClearance (integer $pageId, integer $clearance, boolean $overwrite)
  • integer $pageId: pageid
  • integer $clearance: clearance to add
  • boolean $overwrite: if true overwrites previous clearance
addPageClearances (line 349)

Add Page Clearances

  • access: public
void addPageClearances (CMS_stack $pageClearances)
  • CMS_stack $pageClearances: page clearances to add to this profile
addRowGroupsDenied (line 969)

add Row groups denied

  • access: public
void addRowGroupsDenied (CMS_stack() $rowGroupsDenied)
  • CMS_stack() $rowGroupsDenied
addTemplateGroupsDenied (line 875)

add Templates groups denied

  • access: public
void addTemplateGroupsDenied (CMS_stack() $templateGroupsDenied)
  • CMS_stack() $templateGroupsDenied
addValidationClearance (line 816)

Add Validation Clearance

  • access: public
void addValidationClearance (string $moduleCodename)
  • string $moduleCodename

Redefined in descendants as:
addValidationClearances (line 738)

add Validation Clearances

  • access: public
void addValidationClearances (CMS_stack $validationClearances)
deleteCategoriesClearances (line 1235)

Delete all category clearances for profile

  • return: true on success
  • access: public
boolean deleteCategoriesClearances ()
delModuleClearance (line 669)

Del Module Clearance

  • access: public
void delModuleClearance ( $moduleCodename)
  • $moduleCodename
delModuleClearances (line 657)

Del Module Clearances

  • access: public
void delModuleClearances ()
delPageClearance (line 392)

Del Page Clearance

  • access: public
void delPageClearance ( $pageid)
  • $pageid
delPageClearances (line 380)

Del Page Clearances

  • access: public
void delPageClearances ()
delValidationClearance (line 778)

Del Validation Clearance

  • access: public
void delValidationClearance ( $moduleCodename)
  • $moduleCodename

Redefined in descendants as:
delValidationClearances (line 765)

Del Validation Clearances

  • access: public
void delValidationClearances ()

Redefined in descendants as:
destroy (line 1601)

destroys the cmsprofile from persistence (MySQL for now).

  • access: public
void destroy ()

Redefined in descendants as:
filterModuleCategoriesClearance (line 1448)

filter array of categories ID with user clearance

  • access: public
array filterModuleCategoriesClearance ( $categories, [ $clearance = CLEARANCE_MODULE_VIEW], [string $module = false], [boolean $strict = false], array $categories,, integer $clearance,)
  • array $categories,: IDs of categories to filter
  • integer $clearance,: default is CLEARANCE_MODULE_VIEW
  • string $module: : the module codename
  • boolean $strict: : strict filtering of categories : do not allow parent categories of lower levels
  • $categories
  • $clearance
getAdminClearance (line 296)

Get Administration Clearance

  • access: public
integer getAdminClearance ()
getEditablePageClearanceRoots (line 447)

Get all the editable page roots (page IDs)

  • access: public
array(integer) getEditablePageClearanceRoots ()
getId (line 247)

Get Id

  • access: public
integer getId ()
getModuleCategoriesClearances (line 1155)

Gets clearances on modules categories

  • access: public
CMS_moduleCategoriesClearances getModuleCategoriesClearances ()
getModuleCategoriesClearancesStack (line 1185)

Gets modules categories clarances as a stack

  • access: public
CMS_moduleCategoriesClearances getModuleCategoriesClearancesStack ([ $moduleCodename = false], string $moduleCodename,)
  • string $moduleCodename,: the module to get categories related to
  • $moduleCodename
getModuleClearances (line 646)

Gets Module Clearances

  • access: public
CMS_stack() getModuleClearances ()
getPageClearances (line 365)

Gets Page Clearances

  • access: public
CMS_stack() getPageClearances ()
getRootCategories (line 1271)

Get all the categories (used as root) which have a level equal to clearance given (@see CMS_profile, constants CLEARANCE_MODULE_* )

  • return: or CMS_moduleCategory), false if nothing founded
  • access: public
array(integer getRootCategories ([ $clearance = false], [ $module = false], [ $return_objects = false], [ $strict = true], integer $clearance,, string $module,, boolean $return_objects,, boolean $strict,)
  • integer $clearance,: clearance level categories equals to (Default set to false : returns all categories)
  • string $module,: the module codename we want root categories of
  • boolean $return_objects,: if set to true method will return an array of CMS_moduleCategory (Default set to false)
  • boolean $strict,: if set to true method strictly check clearance (default : true)
  • $clearance
  • $module
  • $return_objects
  • $strict
getRootModuleCategories (line 1255)

Get all the moduleCategories (used as root) which have a level upper or equal to CLEARANCE_MODULE_EDIT

  • return: or CMS_moduleCategory), false if nothing founded
  • access: public
array(integer getRootModuleCategories ([ $module = false], [ $return_objects = false], string $module,, integer $clearance,, boolean $return_objects,)
  • string $module,: the codename of the module we want root categories from
  • integer $clearance,: clearance level categories equals to (Default set to false)
  • boolean $return_objects,: if set to true method will return an array of CMS_moduleCategory (Default set to false)
  • $module
  • $return_objects
getRootModuleCategoriesDenied (line 1327)

Get all the categories (used as root) which have a level equal to CLEARANCE_MODULE_NONE and add deleted categories

  • return: or CMS_moduleCategory), false if nothing founded
  • access: public
array(integer getRootModuleCategoriesDenied ([ $module = false], [ $return_objects = false], string $module,, boolean $return_objects,)
  • string $module,: the codename of the module we want root categories from
  • boolean $return_objects,: if set to true method will return an array of CMS_moduleCategory (Default set to false)
  • $module
  • $return_objects
getRootModuleCategoriesManagable (line 1380)

Get all the categories (used as root) which have a level equal to CLEARANCE_MODULE_MANAGE

  • return: or CMS_moduleCategory), false if nothing founded
  • access: public
array(integer getRootModuleCategoriesManagable ([ $module = false], [ $return_objects = false], string $module,, boolean $return_objects,)
  • string $module,: the codename of the module we want root categories from
  • boolean $return_objects,: if set to true method will return an array of CMS_moduleCategory (Default set to false)
  • $module
  • $return_objects
getRootModuleCategoriesReadable (line 1344)

Get all the categories (used as root) which have a level equal to CLEARANCE_MODULE_VIEW

  • return: or CMS_moduleCategory), false if nothing founded
  • access: public
array(integer getRootModuleCategoriesReadable ([ $module = false], [ $return_objects = false], string $module,, boolean $return_objects,)
  • string $module,: the codename of the module we want root categories from
  • boolean $return_objects,: if set to true method will return an array of CMS_moduleCategory (Default set to false)
  • $module
  • $return_objects
getRootModuleCategoriesWritable (line 1362)

Get all the categories (used as root) which have a level equal to CLEARANCE_MODULE_EDIT

  • return: or CMS_moduleCategory), false if nothing founded
  • access: public
array(integer getRootModuleCategoriesWritable ([ $module = false], [ $return_objects = false], string $module,, boolean $return_objects,)
  • string $module,: the codename of the module we want root categories from
  • boolean $return_objects,: if set to true method will return an array of CMS_moduleCategory (Default set to false)
  • $module
  • $return_objects
getRowGroupsDenied (line 1009)

Gets Row groups denied

  • access: public
CMS_stack() getRowGroupsDenied ()
getTemplateGroupsDenied (line 915)

Gets Templates groups denied

  • access: public
CMS_stack() getTemplateGroupsDenied ()
getValidationClearances (line 754)

Gets Validation Clearances

  • access: public
CMS_stack getValidationClearances ()
getViewablePageClearanceRoots (line 405)

Get all the viewvable page roots (page IDs)

  • access: public
array(integer) getViewablePageClearanceRoots ()
hasAdminAccess (line 321)

Has Administration Access Need an admin clearance or a page edition clearance or a module admin clearance

  • access: public
boolean hasAdminAccess (integer $clearance)
  • integer $clearance: clearance to test for
hasAdminClearance (line 308)

Has Administration Clearance

  • access: public
boolean hasAdminClearance (integer $clearance)
  • integer $clearance: clearance to test for
hasEditableModules (line 489)

Does profile has editable clearances roots (page IDs)

  • access: public
boolean hasEditableModules ()
hasEditablePages (line 468)

Does profile has editable clearances roots (page IDs)

  • access: public
boolean hasEditablePages ()
hasModuleCategoryClearance (line 1398)

Has module category clearance

  • access: public
boolean hasModuleCategoryClearance ( $category_id, [ $clearance = CLEARANCE_MODULE_VIEW], [string $module = false], integer $category_id,, integer $clearance,)
  • integer $category_id,: ID of category we test
  • integer $clearance,: default is CLEARANCE_MODULE_VIEW
  • string $module: : the module codename
  • $category_id
  • $clearance
hasModuleClearance (line 684)

Has Module Clearances

  • access: public
boolean hasModuleClearance (string $moduleCodename, integer $clearance)
  • string $moduleCodename
  • integer $clearance
hasPageClearance (line 513)

has Page Clearances (this function must be as fast as possible because it is often used with APPLICATION_ENFORCES_ACCESS_CONTROL)

  • access: public
boolean hasPageClearance (integer $pageId, integer $clearance)
  • integer $pageId
  • integer $clearance: The clearance to test
hasRowGroupsDenied (line 1027)

Gets Row groups denied

  • access: public
boolean hasRowGroupsDenied (string $rowGroup)
  • string $rowGroup
hasTemplateGroupsDenied (line 933)

Gets Templates groups denied

  • access: public
boolean hasTemplateGroupsDenied (string $templateGroup)
  • string $templateGroup
hasValidationClearance (line 792)

Has Validation Clearance

  • access: public
boolean hasValidationClearance ([string $moduleCodename = false])
  • string $moduleCodename
hasViewvablePages (line 426)

Does profile has visible clearances roots (page IDs)

  • access: public
boolean hasViewvablePages ()
resetClearances (line 1042)

Reset all profile clearances

  • access: public
boolean resetClearances ()
setAdminClearance (line 259)

Sets Administration Clearance

  • access: public
void setAdminClearance (integer $adminClearance)
  • integer $adminClearance
setModuleCategoriesClearances (line 1167)

Sets clearances on modules categories

  • return: true on success
  • access: public
boolean setModuleCategoriesClearances ( $clearances, CMS_moduleCategoriesClearances $clearances,)
setModuleCategoriesClearancesStack (line 1197)

Sets modules categories clearances from a stack

  • return: true on success
  • access: public
boolean setModuleCategoriesClearancesStack ( $clearances, CMS_stack $clearances,)
  • CMS_stack $clearances,: clearances to set
  • $clearances
setModuleClearances (line 614)

Sets Module Clearances

  • access: public
void setModuleClearances (CMS_stack() $moduleClearances)
  • CMS_stack() $moduleClearances
setPageClearances (line 333)

Sets Page Clearances

  • access: public
void setPageClearances (CMS_stack $pageClearances)
  • CMS_stack $pageClearances: page clearances for this profile
setRowGroupsDenied (line 949)

Sets Row groups denied

  • access: public
void setRowGroupsDenied (CMS_stack() $rowGroupsDenied)
  • CMS_stack() $rowGroupsDenied
setTemplateGroupsDenied (line 856)

Sets Templates groups denied

  • access: public
void setTemplateGroupsDenied (CMS_stack() $templateGroupsDenied)
  • CMS_stack() $templateGroupsDenied
setValidationClearances (line 724)

Sets Validation Clearances

  • access: public
void setValidationClearances (CMS_stack $validationClearances)

Redefined in descendants as:
writeToPersistence (line 1622)

Writes the cmsprofile into persistence (MySQL for now).

  • return: true on success, false on failure
  • access: public
boolean writeToPersistence ()

Redefined in descendants as:
_addStackClearances (line 1083)

Add two Clearances stacks together

  • access: public
void _addStackClearances ( $stack1,  $stack2, CMS_stack $pageClearances)
  • CMS_stack $pageClearances: page clearances to add to this profile
  • $stack1
  • $stack2
_filterModuleCategoriesClearanceRecursion (line 1508)
void _filterModuleCategoriesClearanceRecursion ( $nLevelArray,  &$matchingCats,  &$deniedCats,  $fatherRights)
  • $nLevelArray
  • &$matchingCats
  • &$deniedCats
  • $fatherRights
_hasClearance (line 833)

Check if user has a clearance

  • access: private
boolean _hasClearance (CMS_stack $clearances, integer $id, integer $clearance)
  • CMS_stack $clearances
  • integer $id
  • integer $clearance

Inherited Methods

Inherited From CMS_grandFather

 CMS_grandFather::autoload()
 CMS_grandFather::hasError()
 CMS_grandFather::log()
 CMS_grandFather::PHPErrorHandler()
 CMS_grandFather::raiseError()
 CMS_grandFather::setDebug()
 CMS_grandFather::setLog()
 CMS_grandFather::_raiseError()
 CMS_grandFather::__call()
Class Constants
MESSAGE_ALERT_LEVEL_PAGE_ALERTS = 23 (line 52)
MESSAGE_ALERT_LEVEL_PAGE_ALERTS_DESCRIPTION = 337 (line 55)
MESSAGE_ALERT_LEVEL_PROFILE = 22 (line 51)
MESSAGE_ALERT_LEVEL_PROFILE_DESCRIPTION = 336 (line 54)
MESSAGE_ALERT_LEVEL_VALIDATION = 21 (line 50)
MESSAGE_ALERT_LEVEL_VALIDATION_DESCRIPTION = 335 (line 53)
MESSAGE_CLEARANCE_ADMINISTRATION_DUPLICATE_BRANCH = 438 (line 39)
MESSAGE_CLEARANCE_ADMINISTRATION_DUPLICATE_BRANCH_DESCRIPTION = 1448 (line 47)
MESSAGE_CLEARANCE_ADMINISTRATION_EDITUSERS = 77 (line 38)
MESSAGE_CLEARANCE_ADMINISTRATION_EDITUSERS_DESCRIPTION = 492 (line 46)
MESSAGE_CLEARANCE_ADMINISTRATION_EDITVALIDATEALL = 16 (line 33)
MESSAGE_CLEARANCE_ADMINISTRATION_EDITVALIDATEALL_DESCRIPTION = 487 (line 41)
MESSAGE_CLEARANCE_ADMINISTRATION_EDIT_TEMPLATES = 19 (line 36)
MESSAGE_CLEARANCE_ADMINISTRATION_EDIT_TEMPLATES_DESCRIPTION = 490 (line 44)
MESSAGE_CLEARANCE_ADMINISTRATION_PAGE_CODENAMES = 1750 (line 40)
MESSAGE_CLEARANCE_ADMINISTRATION_PAGE_CODENAMES_DESCRIPTION = 1751 (line 48)
MESSAGE_CLEARANCE_ADMINISTRATION_REGENERATEPAGES = 17 (line 34)
MESSAGE_CLEARANCE_ADMINISTRATION_REGENERATEPAGES_DESCRIPTION = 488 (line 42)
MESSAGE_CLEARANCE_ADMINISTRATION_TEMPLATES = 18 (line 35)
MESSAGE_CLEARANCE_ADMINISTRATION_TEMPLATES_DESCRIPTION = 489 (line 43)
MESSAGE_CLEARANCE_ADMINISTRATION_VIEWLOG = 20 (line 37)
MESSAGE_CLEARANCE_ADMINISTRATION_VIEWLOG_DESCRIPTION = 491 (line 45)
MESSAGE_CLEARANCE_MODULE_CATEGORIES_EDIT = 1341 (line 70)
MESSAGE_CLEARANCE_MODULE_CATEGORIES_MANAGE = 1342 (line 71)
MESSAGE_CLEARANCE_MODULE_CATEGORIES_NONE = 266 (line 68)
MESSAGE_CLEARANCE_MODULE_CATEGORIES_VIEW = 1340 (line 69)
MESSAGE_CLEARANCE_MODULE_EDIT = 268 (line 63)
MESSAGE_CLEARANCE_MODULE_EDIT_DESCRIPTION = 472 (line 66)
MESSAGE_CLEARANCE_MODULE_NONE = 266 (line 61)
MESSAGE_CLEARANCE_MODULE_NONE_DESCRIPTION = 470 (line 64)
MESSAGE_CLEARANCE_MODULE_VIEW = 267 (line 62)
MESSAGE_CLEARANCE_MODULE_VIEW_DESCRIPTION = 471 (line 65)
MESSAGE_CLEARANCE_PAGE_EDIT = 3 (line 59)
MESSAGE_CLEARANCE_PAGE_NONE = 1 (line 57)
MESSAGE_CLEARANCE_PAGE_VIEW = 2 (line 58)

Inherited Constants

Inherited from CMS_grandFather

CMS_grandFather::ERROR_LOG
CMS_grandFather::SYSTEM_LABEL

Documentation generated on Wed, 15 Feb 2012 15:37:48 +0100 by phpDocumentor 1.4.3