Add the" Automatically included in private projects" option for a users with viewer acces level.

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
lunalagosmutual
Posts: 1
Joined: 22 Feb 2018, 16:04

Add the" Automatically included in private projects" option for a users with viewer acces level.

Post by lunalagosmutual »

Hi guys,

I have the next problem.

In the version of Mantis 2.11.1 i want assign of the visit/viewer user the option "Automatically included in private projects" but without change the other options for that acces level.
I tried add in at the config_inc.php file the parameter
$g_private_project_threshold = VIEWER;
but when i make that, the all others profiles of acces level same take the option "Automatically included in private projects" and i want this option only for viewer users and administrator users, not for users in the middle.I don't kwon if this is posible, because apparently the level more low affect at the level acces higher.

The option more "easy" is assign manually, all the projects at the new visit user. That is fast using a one query in the server of BD, but i want what this is generic for the new users whith the visit access level.


I hope you can help me, for now i dont have more ideas.

Thanks!!
rkarmann
Posts: 66
Joined: 24 Nov 2017, 10:00
Location: Lille, France

Re: Add the" Automatically included in private projects" option for a users with viewer acces level.

Post by rkarmann »

Hi,

Adding manually users to your private project is safer. But if you really want it to be done automatically...

I recommand to set a new access level in your Mantis installation. In fact, access levels are ordered like numbers :

-10 -> viewer
-25 -> reporter
-40 -> updater
-55 -> developer
-70 -> manager
-90 -> administrator

If you set private project threshold to viewer (10), it means that all users that have a similar or higher access level (10) would be able to see the private project.

In your config_inc.php file, set a new access level, e.g:

Code: Select all

$g_access_levels_enum_string = '10:viewer,25:reporter,40:updater,55:developer,70:manager,80:customViewer,90:administrator';
Here you can see that I add a new access level named : customViewer (linked to the 80). Next, you have to modify the translation string :

Go in lang > strings_english (or whatever is your language) and add the specific access level in the string named:

Code: Select all

$s_access_levels_enum_string = '10:viewer,25:reporter,40:updater,55:developer,70:manager,80:customViewer,90:administrator';
Be aware that such a modification will give users with customViewer access level same rights than a manager (they might be able to do things you don't want them to...).

Regards,

RK
Currently working on a wiki-based plugin for MantisBT 2.X. If you'd like to test it, contact me or see the plugin section.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Add the" Automatically included in private projects" option for a users with viewer acces level.

Post by atrol »

rkarmann wrote: 23 Feb 2018, 09:08 Go in lang > strings_english (or whatever is your language) and add the specific access level in the string named:
Please don't. Such kind of customization should be done in file custom_strings_inc.php
Please use Search before posting and read the Manual
rkarmann
Posts: 66
Joined: 24 Nov 2017, 10:00
Location: Lille, France

Re: Add the" Automatically included in private projects" option for a users with viewer acces level.

Post by rkarmann »

Sorry, I missed that :P
Currently working on a wiki-based plugin for MantisBT 2.X. If you'd like to test it, contact me or see the plugin section.
Post Reply