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

Procedural File: access_api.php

Source Location: /core/access_api.php

Page Details

Access Api

Copyright:  Copyright (C) 2002 - 2009 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 ($t_core_dir.'project_api.php') [line 60]

requires project_api

[ Top ]

require_once ($t_core_dir.'constant_inc.php') [line 40]

require constaint_inc.php for NOBODY etc

[ Top ]

require_once ($t_core_dir.'bug_api.php') [line 56]

requires bug_api

[ Top ]

require_once ($t_core_dir.'helper_api.php') [line 44]

requires helper_api

[ Top ]

require_once ($t_core_dir.'authentication_api.php') [line 48]

requires authentication_api

[ Top ]

require_once ($t_core_dir.'user_api.php') [line 52]

requires user_api

[ Top ]


Globals
array   $g_cache_access_matrix [line 66]
Default value:  array()

[ Top ]

array   $g_cache_access_matrix_project_ids [line 72]
Default value:  array()

[ Top ]

array   $g_cache_access_matrix_user_ids [line 78]
Default value:  array()

[ Top ]


Functions
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

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

API Tags:
Return:  whether user has access to close bugs
Access:  public


[ Top ]
access_can_reopen_bug  [line 535]

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

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

API Tags:
Return:  whether user has access to reopen bugs
Access:  public


[ Top ]
access_compare_level  [line 206]

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

Parameters:
int   $p_user_access_level:  user access level
int|array   $p_threshold:  access threshold, defaults to NOBODY

API Tags:
Return:  true or false depending on whether given access level matches the threshold
Access:  public


[ Top ]
access_denied  [line 85]

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

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

API Tags:
See:  access_has_bugnote_level()
Access:  public


[ 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

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

API Tags:
Return:  whether user has access level specified
See:  access_has_bug_level()
Access:  public


[ Top ]
access_ensure_can_close_bug  [line 522]

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

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

API Tags:
See:  access_can_close_bug()
Access:  public


[ Top ]
access_ensure_can_reopen_bug  [line 556]

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

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

API Tags:
See:  access_can_reopen_bug()
Access:  public


[ Top ]
access_ensure_global_level  [line 267]

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

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

API Tags:
See:  access_has_global_level()
Access:  public


[ Top ]
access_ensure_project_level  [line 363]

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

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

API Tags:
See:  access_has_project_level()
Access:  public


[ Top ]
access_get_global_level  [line 221]

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

Parameters:
int|null   $p_user_id:  integer representing user id, defaults to null to use current user

API Tags:
Return:  global access level
Access:  public


[ Top ]
access_get_local_level  [line 570]

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

Parameters:
int   $p_user_id:  Integer representing user id
int   $p_project_id:  integer representing project id

API Tags:
Return:  returns false (if no access) or an integer representing level of access
Access:  public


[ Top ]
access_get_project_level  [line 282]

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.

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

API Tags:
Return:  access level user has to given project
Access:  public


[ Top ]
access_get_status_threshold  [line 603]

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.

Parameters:
int   $p_status: 
int   $p_project_id:  Default value ALL_PROJECTS

API Tags:
Return:  integer representing user level e.g. DEVELOPER
Access:  public

Information Tags:
Todo:  p_project_id is unused

[ Top ]
access_has_any_project  [line 376]

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

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

API Tags:
Return:  whether user has access level specified
Access:  public


[ 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

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

API Tags:
Return:  whether user has access level specified
Access:  public


[ 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

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

API Tags:
Return:  whether user has access level specified
Access:  public


[ Top ]
access_has_global_level  [line 244]

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.

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

API Tags:
Return:  whether user has access level specified
Access:  public


[ Top ]
access_has_project_level  [line 336]

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.

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

API Tags:
Return:  whether user has access level specified
Access:  public


[ Top ]


Documentation generated on Sun, 05 Apr 2009 23:00:53 +0100 by phpDocumentor 1.4.1