Page 1 of 1

The customized user is also selected in E-mail Notification

Posted: 21 Oct 2013, 15:37
by lchydp
Hello moderator,
I met a problem in the setting of "E-mail Notification" if I use a customized user recently.I define the customized user according to the following steps,
1.Define a new role,CMO,in core/constant_inc.php
# access levels
define( 'ANYBODY', 0 );
define( 'VIEWER', 10 );
define( 'REPORTER', 25 );
define( 'UPDATER', 40 );
define( 'DEVELOPER', 55 );
define( 'CMO', 60 );//new role
define( 'MANAGER', 70 );
define( 'ADMINISTRATOR', 90 );
define( 'NOBODY', 100 );
2.Insert the new role into $g_access_levels_enum_string in config_defaults_inc.php
$g_access_levels_enum_string = '10:viewer,25:reporter,40:updater,55:developer,60:CMO,70:manager,90:administrator';//CMO is the new role.
3.Insert the new role into $s_access_levels_enum_string in lang/strings_english.txt
$s_access_levels_enum_string = '10:viewer,25:reporter,40:updater,55:developer,60:CMO,70:manager,90:administrator';
After did these,the customized user 'CMO' could be shown in MantisBT.
Then I navigated to 'Manage--Manage Configuration--E-mail Notifications'.I found if I checked a user whose access level < CMO and checked a user whose access level > CMO in a line,all the users between them would be selected!For example,only the users in the red rectangles in this picture is set by me.All other selected users are checked worngly.
users.JPG
users.JPG (26.29 KiB) Viewed 5427 times
How to resolve this problem?Thank you very much!

Re: The customized user is also selected in E-mail Notificat

Posted: 21 Oct 2013, 17:08
by atrol
The behavior is confusing and caused by the internal design which allow just setting minimum and maximum access levels but not individual levels.
http://www.mantisbt.org/bugs/view.php?id=6249

Re: The customized user is also selected in E-mail Notificat

Posted: 27 Oct 2013, 06:02
by lchydp
So it means I can' set the notification just for reporter and manager only if I modify the internal design,isn't it?
atrol wrote:The behavior is confusing and caused by the internal design which allow just setting minimum and maximum access levels but not individual levels.
http://www.mantisbt.org/bugs/view.php?id=6249

Re: The customized user is also selected in E-mail Notificat

Posted: 27 Oct 2013, 08:19
by atrol
lchydp wrote:So it means I can' set the notification just for reporter and manager only if I modify the internal design,isn't it?
Yes, the design has to be changed. The current internal approach is that you have just a minimum and maximum access level.

Re: The customized user is also selected in E-mail Notificat

Posted: 27 Oct 2013, 11:29
by lchydp
Thank you very much! :)
atrol wrote:
lchydp wrote:So it means I can' set the notification just for reporter and manager only if I modify the internal design,isn't it?
Yes, the design has to be changed. The current internal approach is that you have just a minimum and maximum access level.