View Issue Details

IDProjectCategoryView StatusLast Update
0020225mantisbtdocumentationpublic2015-10-27 08:53
Reportercproensa Assigned To 
PrioritynoneSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Summary0020225: $g_private_project_threshold as an array
Description

All through the code $g_private_project_threshold is treated as a mixed variable, of type integer, or array.
However, in documentation, config_defaults_inc, and many comments, its stated to be an integer

What is the reason to use it as an array? By definition, i cant understand how that could work.

Anyway, either documentation is wrong, or a lot of code is more complex than needed if its not an array in any case.

TagsNo tags attached.

Activities

atrol

atrol

2015-10-27 08:10

developer   ~0051736

The word threshold is confusing and does not express what the various threshold options mean.
It should be something like allowed_access_levels

Goto page Manage > Manage Configuration > Permissions Report
You will find a row "Automatically included in private projects" where column "administrator" is checked.
This is the visualization of the array $g_private_project_threshold

There can be more than one column checked, e.g. "viewer" and "administrator".
That's why arrays are needed.

Example of a use case that is not that synthetic:
Goto page Manage > Manage Configuration > Workflow Thresholds

Typically the threshold to "Handle an issue" ($g_handle_bug_threshold) is DEVELOPER (which means DEVELOPER, MANAGER and ADMINISTRATOR can be assigned)
In some use cases you don't want the ADMINISTRATOR to be assigned, as he is the administrator who is running the system but not
involved in any project.
Uncheck in row "Handle an issue" column "ADMINISTRATOR" to have an array of DEVELOPER and MANAGER.

atrol

atrol

2015-10-27 08:13

developer   ~0051737

I should have read the documentation before stressing my English ;-)

From https://www.mantisbt.org/docs/master-1.2.x/en/administration_guide.html#ADMIN.USER.ACCESS

Such threshold configuration options can be set to a single access level, which means users with such threshold and above are authorized to do such action. The other option is to specify an array of access level which indicates that users with the explicitly specific thresholds are allowed to do such actions.

cproensa

cproensa

2015-10-27 08:53

developer   ~0051738

That is some ambiguity. At least i got it clear now.
Anyway, thanks atrol, excellent explanation

However, most of the comments supporting its usage in codebase are then misleading, as it says its type integer.

Issue History

Date Modified Username Field Change
2015-10-26 21:04 cproensa New Issue
2015-10-27 08:10 atrol Note Added: 0051736
2015-10-27 08:13 atrol Note Added: 0051737
2015-10-27 08:53 cproensa Note Added: 0051738