Page 1 of 1

Custom access level

Posted: 24 Sep 2020, 21:41
by mnemonicator
Hello colleagues, i am using MantisBT 2.24.2 and trying to setup custom access level.

I set a new constant in a custom_constants_inc.php

Code: Select all

<?php
define('EDITOR',45);
?>
then i add next test to the config_inc.php

Code: Select all

$g_access_levels_enum_string = '10:viewer,25:reporter,40:updater,45:editor,55:developer,70:manager,90:administrator';
and i also modify strings_english.txt

Code: Select all

# Enum Strings
$s_access_levels_enum_string = '10:viewer,25:reporter,40:updater,45:editor,55:developer,70:manager,90:administrator';
All lokks good, i see new access level.

Now i trying to change this default constant $g_stored_query_create_threshold = DEVELOPER;

so i add next text to the config_inc.php

$g_stored_query_create_threshold = editor;

But i see that every role is able to create filters, i tried to change this to standard role updater, but still every role from viewer to administrator is able to create filters.

What's wrong and how to fix this?

thank you.

Re: Custom access level

Posted: 25 Sep 2020, 09:02
by atrol
Didn't have a deeper look, but this is certainly wrong
mnemonicator wrote: 24 Sep 2020, 21:41 $g_stored_query_create_threshold = editor;
editor is not a defined constant, you have to change it to EDITOR
mnemonicator wrote: 24 Sep 2020, 21:41 and i also modify strings_english.txt
Changing original files of Mantis is not recommended, as you will loose the changes after an upgrade.
String customization should be done in custom_strings_inc.php

Re: Custom access level

Posted: 25 Sep 2020, 09:05
by mnemonicator
Thank you very much, this fix my problem!