Page 1 of 1

Hide "Manage Columns" from certain groups

Posted: 20 Dec 2011, 18:31
by KenTech
I created a test account (reporter) to see what their view would look like. When I went to "My Account" I saw that they have access to "Manage Columns" and "Profiles" which I definitely do not want them to have access to at all. Where can I set the permissions so this doesn't show for anyone who is not at least a developer?

Thanks.

Re: Hide "Manage Columns" from certain groups

Posted: 21 Dec 2011, 08:02
by atrol
You can set the user to "protected" in UI of user management. So he will not get the "My account" link and is not able to change any setting.

To disable just the profiles add the following line to config_inc.php

Code: Select all

$g_add_profile_threshold = DEVELOPER;
There is is no option to prevent changing the columns.

Re: Hide "Manage Columns" from certain groups

Posted: 21 Dec 2011, 16:24
by andrea.mills
It is my understanding that the "Manage Columns" and "Profiles" buttons that reporters (and every other user) sees under the "My Account" section only applies to that user. So when I added "Reporter" to my columns in the view page, no one else sees that change.

Re: Hide "Manage Columns" from certain groups

Posted: 21 Dec 2011, 16:39
by atrol
andrea.mills wrote:It is my understanding that the "Manage Columns" and "Profiles" buttons that reporters (and every other user) sees under the "My Account" section only applies to that user. So when I added "Reporter" to my columns in the view page, no one else sees that change.
You are right, but I think that KenTech wants to be sure that all users get the same view and that a user is not able to hide a field which is considered to be important.
Let's wait for his feedback.

Re: Hide "Manage Columns" from certain groups

Posted: 21 Dec 2011, 16:58
by KenTech
atrol wrote:You can set the user to "protected" in UI of user management. So he will not get the "My account" link and is not able to change any setting.

To disable just the profiles add the following line to config_inc.php

Code: Select all

$g_add_profile_threshold = DEVELOPER;
There is is no option to prevent changing the columns.
Thank you for that, but I don't want to limit the preferences altogether. Maybe I'll try the $g_add_profile_threshold variable.
andrea.mills wrote:It is my understanding that the "Manage Columns" and "Profiles" buttons that reporters (and every other user) sees under the "My Account" section only applies to that user. So when I added "Reporter" to my columns in the view page, no one else sees that change.
You know, I had that thought after I posted it. I'll test it a little more on my side. I just thought that whole tab was a bit confusing for our beta testers.

Re: Hide "Manage Columns" from certain groups

Posted: 21 Dec 2011, 17:06
by KenTech
atrol wrote:
andrea.mills wrote:It is my understanding that the "Manage Columns" and "Profiles" buttons that reporters (and every other user) sees under the "My Account" section only applies to that user. So when I added "Reporter" to my columns in the view page, no one else sees that change.
You are right, but I think that KenTech wants to be sure that all users get the same view and that a user is not able to hide a field which is considered to be important.
Let's wait for his feedback.
Yes, you are correct. We want to control what our beta testers see. They might hide an important field.

While I love all the features of Mantis, I wish some of these variables were built into the back end into a more friendly UI.

Re: Hide "Manage Columns" from certain groups

Posted: 21 Dec 2011, 17:36
by KenTech
atrol wrote:
andrea.mills wrote:It is my understanding that the "Manage Columns" and "Profiles" buttons that reporters (and every other user) sees under the "My Account" section only applies to that user. So when I added "Reporter" to my columns in the view page, no one else sees that change.
You are right, but I think that KenTech wants to be sure that all users get the same view and that a user is not able to hide a field which is considered to be important.
Let's wait for his feedback.
You are correct. Is there a variable for the manage columns threshold? I scoured the Mantis documentation but could not find any reference to even the variable for $g_add_profile_threshold variable.

Re: Hide "Manage Columns" from certain groups

Posted: 21 Dec 2011, 20:01
by atrol
KenTech wrote:Is there a variable for the manage columns threshold?
Still no ;-)
atrol wrote: There is is no option to prevent changing the columns.

Re: Hide "Manage Columns" from certain groups

Posted: 21 Dec 2011, 20:04
by atrol
KenTech wrote:I scoured the Mantis documentation but could not find any reference to even the variable for $g_add_profile_threshold variable.
Developers don't like writing documentations ;-)
The best way to get an impression of MantisBT's configuration options is to read config_defaults_inc.php

Re: Hide "Manage Columns" from certain groups

Posted: 21 Dec 2011, 21:42
by KenTech
atrol wrote:
KenTech wrote:Is there a variable for the manage columns threshold?
Still no ;-)
atrol wrote: There is is no option to prevent changing the columns.
Darn it! Any idea where in the code the option for the profile threshold is located? I might take a peek at the code for a possible mod.

Re: Hide "Manage Columns" from certain groups

Posted: 21 Dec 2011, 21:50
by atrol

Code: Select all

account_prof_menu_page.php
	Line 48: 		access_ensure_global_level( config_get( 'add_profile_threshold' ) );
account_prof_update.php
	Line 61: 				access_ensure_global_level( config_get( 'add_profile_threshold' ) );
adm_permissions_report.php
	Line 140: 	echo get_capability_row( lang_get( 'add_profiles' ), config_get( 'add_profile_threshold' ) );
config_defaults_inc.php
	Line 3618: 	$g_add_profile_threshold = REPORTER;
core\html_api.php
	Line 1112: 	if( config_get ( 'enable_profiles' ) == ON && access_has_project_level( config_get( 'add_profile_threshold' ) ) ) {

Re: Hide "Manage Columns" from certain groups

Posted: 21 Dec 2011, 22:26
by KenTech
In file: core\html_api.php

Code: Select all

Line 1112:if( config_get ( 'enable_profiles' ) == ON && access_has_project_level( config_get( 'add_profile_threshold' ) ) ) {
		print_bracket_link( helper_mantis_url( $t_account_profile_menu_page ), lang_get( 'manage_profiles_link' ) );
	}

Add after

Code: Select all

	//Mod to control visibility of [Manage Columns] link
	if( access_has_project_level( config_get( 'manage_columns_threshold' ) ) ) {
		print_bracket_link( helper_mantis_url( $t_account_manage_columns_page ), lang_get( 'manage_columns_config' ) );
	}
Append to: config.inc.php

Code: Select all

	$g_manage_columns_threshold = DEVELOPER;
So far it's working exactly how I wanted.