View Issue Details

IDProjectCategoryView StatusLast Update
0025019mantisbtfeaturepublic2018-12-16 09:20
Reportercristobal.manrique Assigned Tocproensa  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionno change required 
Product Version2.15.1 
Summary0025019: Access_has_local_level
Description

I want to check user permission againts the user's local level. This is, the level of the user for a specific project, regardless of the user global access level. (project is private, so i don't want to allow the user to access based on it's global level).

Even when i could finally figure out how the access_api works, I guess that a function like "acces_has_local_level" would be the natural way to check this.

I mean, there are these functions in the acess_api:
access_get_global_level
access_get_local_level
access_get_project_level

But there are only two corresponding functions:
access_has_global_level (makes use of access_get_global_level)
access_has_project_level(makes use of access_get_project_level)

Shouldn't we have an "access_has_local_level" function, making use of access_get_local_level?

TIA.

TagsNo tags attached.

Activities

cproensa

cproensa

2018-12-04 05:46

developer   ~0061037

Last edited: 2018-12-04 05:48

This function has a very specific purpose, as you can read in the comments:

access_get_local_level
get the user's access level specific to this project. return false (0) if the user has no access override here

This doesn't return a consolidated access level.

Mantis stacks the different rules for global access, project overrides, private threshold...
When querying access api to check for access, in specific contexts (global, a project, a bug id) we use:

  • access_has_global_level: checks only global access
  • access_has_project_level: also checks project overrides, plus private thresholds
  • access_has_bug_level: also checks 'limit reporters'

So far we don't have any real use case for access_has_local_level

I want to check user permission againts the user's local level. This is, the level of the user for a specific project, regardless of the user global access level.

you want to use access_has_project_level