[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/core/ -> access_api.php (summary)

Access API

Copyright: Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
Copyright: Copyright (C) 2002 - 2011 MantisBT Team - mantisbt-dev@lists.sourceforge.net
File Size: 608 lines (22 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 21 functions

  access_denied()
  access_cache_matrix_project()
  access_cache_matrix_user()
  access_compare_level()
  access_get_global_level()
  access_has_global_level()
  access_ensure_global_level()
  access_get_project_level()
  access_has_project_level()
  access_ensure_project_level()
  access_has_any_project()
  access_has_bug_level()
  access_ensure_bug_level()
  access_has_bugnote_level()
  access_ensure_bugnote_level()
  access_can_close_bug()
  access_ensure_can_close_bug()
  access_can_reopen_bug()
  access_ensure_can_reopen_bug()
  access_get_local_level()
  access_get_status_threshold()

Functions
Functions that are not part of a class:

access_denied()   X-Ref
Function to be called when a user is attempting to access a page that
he/she is not authorised to.  This outputs an access denied message then
re-directs to the mainpage.


access_cache_matrix_project( $p_project_id )   X-Ref
retrieves and returns access matrix for a project from cache or caching if required.

param: int $p_project_id integer representing project id
return: array returns an array of users->accesslevel for the given user

access_cache_matrix_user( $p_user_id )   X-Ref
retrieves and returns access matrix for a user from cache or caching if required.

param: int $p_user_id integer representing user id
return: array returns an array of projects->accesslevel for the given user

access_compare_level( $p_user_access_level, $p_threshold = NOBODY )   X-Ref
Check the a user's access against the given "threshold" and return true
if the user can access, false otherwise.
$p_access_level may be a single value, or an array. If it is a single
value, treat it as a threshold so return true if user is >= threshold.
If it is an array, look for exact matches to one of the values

param: int $p_user_access_level user access level
param: int|array $p_threshold access threshold, defaults to NOBODY
return: bool true or false depending on whether given access level matches the threshold

access_get_global_level( $p_user_id = null )   X-Ref
This function only checks the user's global access level, ignoring any
overrides they might have at a project level

param: int|null $p_user_id integer representing user id, defaults to null to use current user
return: int global access level

access_has_global_level( $p_access_level, $p_user_id = null )   X-Ref
Check the current user's access against the given value and return true
if the user's access is equal to or higher, false otherwise.

param: int $p_access_level integer representing access level
param: int|null $p_user_id integer representing user id, defaults to null to use current user
return: bool whether user has access level specified

access_ensure_global_level( $p_access_level, $p_user_id = null )   X-Ref
Check if the user has the specified global access level
and deny access to the page if not

param: int $p_access_level integer representing access level
param: int|null $p_user_id integer representing user id, defaults to null to use current user

access_get_project_level( $p_project_id = null, $p_user_id = null )   X-Ref
This function checks the project access level first (for the current project
if none is specified) and if the user is not listed, it falls back on the
user's global access level.

param: int $p_project_id integer representing project id to check access against
param: int|null $p_user_id integer representing user id, defaults to null to use current user
return: int access level user has to given project

access_has_project_level( $p_access_level, $p_project_id = null, $p_user_id = null )   X-Ref
Check the current user's access against the given value and return true
if the user's access is equal to or higher, false otherwise.

param: int $p_access_level integer representing access level
param: int $p_project_id integer representing project id to check access against
param: int|null $p_user_id integer representing user id, defaults to null to use current user
return: bool whether user has access level specified

access_ensure_project_level( $p_access_level, $p_project_id = null, $p_user_id = null )   X-Ref
Check if the user has the specified access level for the given project
and deny access to the page if not

param: int $p_access_level integer representing access level
param: int|null $p_project_id integer representing project id to check access against, defaults to null to use current project
param: int|null $p_user_id integer representing user id, defaults to null to use current user

access_has_any_project( $p_access_level, $p_user_id = null )   X-Ref
Check whether the user has the specified access level for any project project

param: int $p_access_level integer representing access level
param: int|null $p_user_id integer representing user id, defaults to null to use current user
return: bool whether user has access level specified

access_has_bug_level( $p_access_level, $p_bug_id, $p_user_id = null )   X-Ref
Check the current user's access against the given value and return true
if the user's access is equal to or higher, false otherwise.
This function looks up the bug's project and performs an access check
against that project

param: int $p_access_level integer representing access level
param: int $p_bug_id integer representing bug id to check access against
param: int|null $p_user_id integer representing user id, defaults to null to use current user
return: bool whether user has access level specified

access_ensure_bug_level( $p_access_level, $p_bug_id, $p_user_id = null )   X-Ref
Check if the user has the specified access level for the given bug
and deny access to the page if not

param: int $p_access_level integer representing access level
param: int $p_bug_id integer representing bug id to check access against
param: int|null $p_user_id integer representing user id, defaults to null to use current user
return: bool whether user has access level specified

access_has_bugnote_level( $p_access_level, $p_bugnote_id, $p_user_id = null )   X-Ref
Check the current user's access against the given value and return true
if the user's access is equal to or higher, false otherwise.
This function looks up the bugnote's bug and performs an access check
against that bug

param: int $p_access_level integer representing access level
param: int $p_bugnote_id integer representing bugnote id to check access against
param: int|null $p_user_id integer representing user id, defaults to null to use current user
return: bool whether user has access level specified

access_ensure_bugnote_level( $p_access_level, $p_bugnote_id, $p_user_id = null )   X-Ref
Check if the user has the specified access level for the given bugnote
and deny access to the page if not

param: int $p_access_level integer representing access level
param: int $p_bugnote_id integer representing bugnote id to check access against
param: int|null $p_user_id integer representing user id, defaults to null to use current user

access_can_close_bug( $p_bug_id, $p_user_id = null )   X-Ref
Check if the current user can close the specified bug

param: int $p_bug_id integer representing bug id to check access against
param: int|null $p_user_id integer representing user id, defaults to null to use current user
return: bool whether user has access to close bugs

access_ensure_can_close_bug( $p_bug_id, $p_user_id = null )   X-Ref
Make sure that the current user can close the specified bug

param: int $p_bug_id integer representing bug id to check access against
param: int|null $p_user_id integer representing user id, defaults to null to use current user

access_can_reopen_bug( $p_bug_id, $p_user_id = null )   X-Ref
Check if the current user can reopen the specified bug

param: int $p_bug_id integer representing bug id to check access against
param: int|null $p_user_id integer representing user id, defaults to null to use current user
return: bool whether user has access to reopen bugs

access_ensure_can_reopen_bug( $p_bug_id, $p_user_id = null )   X-Ref
Make sure that the current user can reopen the specified bug.
Calls access_denied if user has no access to terminate script

param: int $p_bug_id integer representing bug id to check access against
param: int|null $p_user_id integer representing user id, defaults to null to use current user

access_get_local_level( $p_user_id, $p_project_id )   X-Ref
get the user's access level specific to this project.
return false (0) if the user has no access override here

param: int $p_user_id Integer representing user id
param: int $p_project_id integer representing project id
return: bool|int returns false (if no access) or an integer representing level of access

access_get_status_threshold( $p_status, $p_project_id = ALL_PROJECTS )   X-Ref
get the access level required to change the issue to the new status
If there is no specific differentiated access level, use the
generic update_bug_status_threshold.

param: int $p_status
param: int $p_project_id Default value ALL_PROJECTS
return: int integer representing user level e.g. DEVELOPER



Generated: Thu Jul 28 15:48:31 2011 Cross-referenced by PHPXref 0.7