Hide Help Menu item based on custom role or sub-account

Jump to solution
MikeBrinkman
Community Participant

I created a new sub-account for a new program we're staring. I have also created a duplicate of the student role for these students. There are a couple of menu items on the Help menu that I would like hidden from the students in just this sub-account. How would I go about hiding the menu items from these students? The duplicate role does not show up as an option when I am editing the permissions, and when I go into the sub-account, there isn't an option to edit the help menu.

Labels (2)
0 Likes
1 Solution
dtod
Community Contributor

Would this in the sub-account theme do the job? Part of the problem is that the Help menu is built on the fly using React so you have to monitor it.

function hideHelpItem(){
	if ( ENV.current_user_is_student ){
		console.log('adding dom monitor');
		$("body").on('DOMSubtreeModified', "#help_tray", function() {
			console.log('hiding help item');
			$('#help_tray a:contains("Thing you want to hide")').hide();
		});	
	}
}

$(document).ready(function () {
	hideHelpItem();
});

 

View solution in original post