Returns array with translation key values for all admin clearance constants
static array(integer=>integer)
getAllAdminClearances
()
Returns array with translation key values for all module level constants
static array(integer=>integer)
getAllModuleCategoriesClearances
()
Returns array with translation key values for all module level constants
static array(integer
getAllModuleClearances
()
Returns array with translation key values for all clearance page level constants
static array(integer=>integer)
getAllPageClearances
()
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)
static The
getPageClearanceRoot
(integer $pageId, [ $outputCMS_page = true])
-
integer
$pageId: The DB ID of the page we test
-
$outputCMS_page
Constructor.
initializes the profile from the database if the id is given
void
__construct
([integer $id = 0])
-
integer
$id: if of profile
Redefined in descendants as:
add Administration Clearance
void
addAdminClearance
(integer $adminClearance)
Add a given group to user
boolean
addGroup
(mixed $group)
-
mixed
$group: : the group to add or the group id to add
Sets modules categories clearances from a stack
boolean
addModuleCategoriesClearancesStack
(
$clearances,
CMS_stack $clearances,)
-
CMS_stack
$clearances,: clearances to set
-
$clearances
add Module Clearances
void
addModuleClearance
(string $moduleCodename, integer $clearance, boolean $overwrite)
-
string
$moduleCodename
-
integer
$clearance
-
boolean
$overwrite: if true overwrites previous clearance if clearance exists
add Module Clearances
void
addModuleClearances
(CMS_stack() $moduleClearances)
-
CMS_stack()
$moduleClearances
add Page Clearances
void
addPageClearance
(integer $pageId, integer $clearance, boolean $overwrite)
-
integer
$pageId: pageid
-
integer
$clearance: clearance to add
-
boolean
$overwrite: if true overwrites previous clearance
Add Page Clearances
void
addPageClearances
(
CMS_stack $pageClearances)
-
CMS_stack
$pageClearances: page clearances to add to this profile
add Row groups denied
void
addRowGroupsDenied
(CMS_stack() $rowGroupsDenied)
-
CMS_stack()
$rowGroupsDenied
add Templates groups denied
void
addTemplateGroupsDenied
(CMS_stack() $templateGroupsDenied)
-
CMS_stack()
$templateGroupsDenied
Add Validation Clearance
void
addValidationClearance
(string $moduleCodename)
Redefined in descendants as:
add Validation Clearances
void
addValidationClearances
(
CMS_stack $validationClearances)
Delete all category clearances for profile
boolean
deleteCategoriesClearances
()
Del Module Clearance
void
delModuleClearance
( $moduleCodename)
Del Module Clearances
void
delModuleClearances
()
Del Page Clearance
void
delPageClearance
( $pageid)
Del Page Clearances
void
delPageClearances
()
Del Validation Clearance
void
delValidationClearance
( $moduleCodename)
Redefined in descendants as:
Del Validation Clearances
void
delValidationClearances
()
Redefined in descendants as:
destroys the cmsprofile from persistence (MySQL for now).
void
destroy
()
Redefined in descendants as:
filter array of categories ID with user clearance
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
Get Administration Clearance
integer
getAdminClearance
()
Get all the editable page roots (page IDs)
array(integer)
getEditablePageClearanceRoots
()
Gets clearances on modules categories
Gets modules categories clarances as a stack
-
string
$moduleCodename,: the module to get categories related to
-
$moduleCodename
Gets Module Clearances
CMS_stack()
getModuleClearances
()
Gets Page Clearances
CMS_stack()
getPageClearances
()
Get all the categories (used as root) which have a level equal to clearance given (@see CMS_profile, constants CLEARANCE_MODULE_* )
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
Get all the moduleCategories (used as root) which have a level upper or equal to CLEARANCE_MODULE_EDIT
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
Get all the categories (used as root) which have a level equal to CLEARANCE_MODULE_NONE and add deleted categories
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
Get all the categories (used as root) which have a level equal to CLEARANCE_MODULE_MANAGE
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
Get all the categories (used as root) which have a level equal to CLEARANCE_MODULE_VIEW
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
Get all the categories (used as root) which have a level equal to CLEARANCE_MODULE_EDIT
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
Gets Row groups denied
CMS_stack()
getRowGroupsDenied
()
Gets Templates groups denied
CMS_stack()
getTemplateGroupsDenied
()
Gets Validation Clearances
Get all the viewvable page roots (page IDs)
array(integer)
getViewablePageClearanceRoots
()
Has Administration Access Need an admin clearance or a page edition clearance or a module admin clearance
boolean
hasAdminAccess
(integer $clearance)
-
integer
$clearance: clearance to test for
Has Administration Clearance
boolean
hasAdminClearance
(integer $clearance)
-
integer
$clearance: clearance to test for
Does profile has editable clearances roots (page IDs)
boolean
hasEditableModules
()
Does profile has editable clearances roots (page IDs)
boolean
hasEditablePages
()
Has module category clearance
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
Has Module Clearances
boolean
hasModuleClearance
(string $moduleCodename, integer $clearance)
-
string
$moduleCodename
-
integer
$clearance
has Page Clearances (this function must be as fast as possible because it is often used with APPLICATION_ENFORCES_ACCESS_CONTROL)
boolean
hasPageClearance
(integer $pageId, integer $clearance)
-
integer
$pageId
-
integer
$clearance: The clearance to test
Gets Row groups denied
boolean
hasRowGroupsDenied
(string $rowGroup)
Gets Templates groups denied
boolean
hasTemplateGroupsDenied
(string $templateGroup)
Has Validation Clearance
boolean
hasValidationClearance
([string $moduleCodename = false])
Does profile has visible clearances roots (page IDs)
boolean
hasViewvablePages
()
Reset all profile clearances
boolean
resetClearances
()
Sets Administration Clearance
void
setAdminClearance
(integer $adminClearance)
Sets clearances on modules categories
Sets modules categories clearances from a stack
boolean
setModuleCategoriesClearancesStack
(
$clearances,
CMS_stack $clearances,)
-
CMS_stack
$clearances,: clearances to set
-
$clearances
Sets Module Clearances
void
setModuleClearances
(CMS_stack() $moduleClearances)
-
CMS_stack()
$moduleClearances
Sets Page Clearances
void
setPageClearances
(
CMS_stack $pageClearances)
-
CMS_stack
$pageClearances: page clearances for this profile
Sets Row groups denied
void
setRowGroupsDenied
(CMS_stack() $rowGroupsDenied)
-
CMS_stack()
$rowGroupsDenied
Sets Templates groups denied
void
setTemplateGroupsDenied
(CMS_stack() $templateGroupsDenied)
-
CMS_stack()
$templateGroupsDenied
Sets Validation Clearances
void
setValidationClearances
(
CMS_stack $validationClearances)
Redefined in descendants as:
Writes the cmsprofile into persistence (MySQL for now).
boolean
writeToPersistence
()
Redefined in descendants as:
Add two Clearances stacks together
void
_addStackClearances
(
$stack1,
$stack2,
CMS_stack $pageClearances)
-
CMS_stack
$pageClearances: page clearances to add to this profile
-
$stack1
-
$stack2
void
_filterModuleCategoriesClearanceRecursion
( $nLevelArray, &$matchingCats, &$deniedCats, $fatherRights)
-
$nLevelArray
-
&$matchingCats
-
&$deniedCats
-
$fatherRights
Check if user has a clearance
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()