[ARCHIVED] Help with a custom JS File??

Jump to solution
shane_ohara
Community Champion

Hello,

I am seeking some support to hide certain elements (buttons) from a new account-level admin role.

History: account-level permissions are not granular enough to remove access to certain buttons (create new course, conclude course, delete course, etc.) when you assign the "Manage Courses" permission to a new account-level admin. This permission is necessary in order for a team of staff to see the "Student View" button and items listed on the "Syllabus" page, among other course options.

What I need assistance with: I need to hide buttons that this team of staff received by virtue of the permission, but need to do so through our custom JS file. Currently we have delete, conclude, and reset courses hidden through JS to anyone without the "admin" role, but by doing so this allows the secondary account-level admin role access to the buttons, and others (create a new course, etc.)

I am using the following to start my JS:

$(document).ready(function(){

if($.inArray('admin',ENV['current_user_roles']) == -1) {

How can I revise this to declare that only the "Account Admin" and not any other manually created account-level admin can have access?

Many thanks,

Shane

Labels (1)
1 Solution
shane_ohara
Community Champion
Author

Our CSM passed me onto our previous implementation consultant for assistance. He sent me the following last night:

"I've followed up with some friends here at the office, and they've let me know that there's currently no way to have global includes specific to custom roles. I wish I had an alternative solution for updating removing this functionality, but at this time I do not. I suggest submitting a feature idea or voting on an existing one.

I can see Cosme Salazar last updated " modifiedtitle="true" title="this feature idea in July explaining why it's difficult for us to make custom roles more granular. I know our production team is working on making the permission sets more detailed, but at this time I have little options available to us. I apologize for any inconveniences this may be causing you."

Looks like we'll have to rethink our approach.

Shane

View solution in original post