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

Procedural File: access_api.php

Source Location: /core/access_api.php



Page Details:

Access Api



Tags:

copyright:  Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
copyright:  Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
link:  http://www.mantisbt.org
uses:  helper_api.php
usedby:  bug_is_readonly()
uses:  database_api.php
uses:  project_api.php
uses:  bug_api.php
uses:  auth_api.php
uses:  bugnote_api.php
uses:  config_api.php


Includes:

require_once('project_api.php') [line 58]
requires project_api

require_once('constant_inc.php') [line 38]
require constaint_inc.php for NOBODY etc

require_once('bug_api.php') [line 54]
requires bug_api

require_once('helper_api.php') [line 42]
requires helper_api

require_once('authentication_api.php') [line 46]
requires authentication_api

require_once('user_api.php') [line 50]
requires user_api




array $g_cache_access_matrix [line 64]

Default value:   array()


[ Top ]



array $g_cache_access_matrix_project_ids [line 70]

Default value:   array()


[ Top ]



array $g_cache_access_matrix_user_ids [line 76]

Default value:   array()


[ Top ]






access_can_close_bug [line 502]

bool access_can_close_bug( int $p_bug_id, [int|null $p_user_id = null])

Check if the current user can close the specified bug



Tags:

return:  whether user has access to close bugs
access:  public


Parameters

int   $p_bug_id   integer representing bug id to check access against
int|null   $p_user_id   integer representing user id, defaults to null to use current user
[ Top ]



access_can_reopen_bug [line 539]

bool access_can_reopen_bug( int $p_bug_id, [int|null $p_user_id = null])

Check if the current user can reopen the specified bug



Tags:

return:  whether user has access to reopen bugs
access:  public


Parameters

int   $p_bug_id   integer representing bug id to check access against
int|null   $p_user_id   integer representing user id, defaults to null to use current user
[ Top ]



access_compare_level [line 204]

bool access_compare_level( int $p_user_access_level, [int|array $p_threshold = NOBODY])

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




Tags:

return:  true or false depending on whether given access level matches the threshold
access:  public


Parameters

int   $p_user_access_level   user access level
int|array   $p_threshold   access threshold, defaults to NOBODY
[ Top ]



access_denied [line 83]

void access_denied( )

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.



[ Top ]



access_ensure_bugnote_level [line 489]

void access_ensure_bugnote_level( int $p_access_level, int $p_bugnote_id, [int|null $p_user_id = null])

Check if the user has the specified access level for the given bugnote

and deny access to the page if not




Tags:

see:  access_has_bugnote_level()
access:  public


Parameters

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



access_ensure_bug_level [line 447]

bool access_ensure_bug_level( int $p_access_level, int $p_bug_id, [int|null $p_user_id = null])

Check if the user has the specified access level for the given bug

and deny access to the page if not




Tags:

return:  whether user has access level specified
see:  access_has_bug_level()
access:  public


Parameters

int   $p_access_level   integer representing access level
int   $p_bug_id   integer representing bug id to check access against
int|null   $p_user_id   integer representing user id, defaults to null to use current user
[ Top ]



access_ensure_can_close_bug [line 526]

void access_ensure_can_close_bug( int $p_bug_id, [int|null $p_user_id = null])

Make sure that the current user can close the specified bug



Tags:

see:  access_can_close_bug()
access:  public


Parameters

int   $p_bug_id   integer representing bug id to check access against
int|null   $p_user_id   integer representing user id, defaults to null to use current user
[ Top ]



access_ensure_can_reopen_bug [line 560]

void access_ensure_can_reopen_bug( int $p_bug_id, [int|null $p_user_id = null])

Make sure that the current user can reopen the specified bug.

Calls access_denied if user has no access to terminate script




Tags:

see:  access_can_reopen_bug()
access:  public


Parameters

int   $p_bug_id   integer representing bug id to check access against
int|null   $p_user_id   integer representing user id, defaults to null to use current user
[ Top ]



access_ensure_global_level [line 265]

void access_ensure_global_level( int $p_access_level, [int|null $p_user_id = null])

Check if the user has the specified global access level

and deny access to the page if not




Tags:

see:  access_has_global_level()
access:  public


Parameters

int   $p_access_level   integer representing access level
int|null   $p_user_id   integer representing user id, defaults to null to use current user
[ Top ]



access_ensure_project_level [line 362]

void access_ensure_project_level( int $p_access_level, [int|null $p_project_id = null], [int|null $p_user_id = null])

Check if the user has the specified access level for the given project

and deny access to the page if not




Tags:

see:  access_has_project_level()
access:  public


Parameters

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



access_get_global_level [line 219]

int access_get_global_level( [int|null $p_user_id = null])

This function only checks the user's global access level, ignoring any

overrides they might have at a project level




Tags:

return:  global access level
access:  public


Parameters

int|null   $p_user_id   integer representing user id, defaults to null to use current user
[ Top ]



access_get_local_level [line 574]

bool|int access_get_local_level( int $p_user_id, int $p_project_id)

get the user's access level specific to this project.

return false (0) if the user has no access override here




Tags:

return:  returns false (if no access) or an integer representing level of access
access:  public


Parameters

int   $p_user_id   Integer representing user id
int   $p_project_id   integer representing project id
[ Top ]



access_get_project_level [line 280]

int access_get_project_level( [int $p_project_id = null], [int|null $p_user_id = null])

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.



Tags:

return:  access level user has to given project
access:  public


Parameters

int   $p_project_id   integer representing project id to check access against
int|null   $p_user_id   integer representing user id, defaults to null to use current user
[ Top ]



access_get_status_threshold [line 606]

int access_get_status_threshold( int $p_status, [int $p_project_id = ALL_PROJECTS])

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.



Tags:

return:  integer representing user level e.g. DEVELOPER
access:  public


Parameters

int   $p_status  
int   $p_project_id   Default value ALL_PROJECTS
[ Top ]



access_has_any_project [line 375]

bool access_has_any_project( int $p_access_level, [int|null $p_user_id = null])

Check whether the user has the specified access level for any project project



Tags:

return:  whether user has access level specified
access:  public


Parameters

int   $p_access_level   integer representing access level
int|null   $p_user_id   integer representing user id, defaults to null to use current user
[ Top ]



access_has_bugnote_level [line 464]

bool access_has_bugnote_level( int $p_access_level, int $p_bugnote_id, [int|null $p_user_id = null])

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




Tags:

return:  whether user has access level specified
access:  public


Parameters

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



access_has_bug_level [line 407]

bool access_has_bug_level( int $p_access_level, int $p_bug_id, [int|null $p_user_id = null])

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




Tags:

return:  whether user has access level specified
access:  public


Parameters

int   $p_access_level   integer representing access level
int   $p_bug_id   integer representing bug id to check access against
int|null   $p_user_id   integer representing user id, defaults to null to use current user
[ Top ]



access_has_global_level [line 242]

bool access_has_global_level( int $p_access_level, [int|null $p_user_id = null])

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.



Tags:

return:  whether user has access level specified
access:  public


Parameters

int   $p_access_level   integer representing access level
int|null   $p_user_id   integer representing user id, defaults to null to use current user
[ Top ]



access_has_project_level [line 335]

bool access_has_project_level( int $p_access_level, [int $p_project_id = null], [int|null $p_user_id = null])

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.



Tags:

return:  whether user has access level specified
access:  public


Parameters

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



Documentation generated on Sun, 12 Dec 2010 23:50:03 +0900 by phpDocumentor 1.4.3
inserted by FC2 system