AnsweredAssumed Answered

Hide/Show Buttons for Certain user roles

Question asked by Xavier Cotto on Jul 29, 2016
Latest reply on Jul 30, 2016 by Alex Clement

Hi Team


We have this JS to Hide the following buttons for Teacher Roles.


The problem is that I have the Account Admin role but when I created a manually courses I get enrolled automatically  as a Teacher role and the JS automatically hides me those buttons.


Actual Code:


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



       $("a:contains('Conclude this Course')").hide();

       $("a:contains('Export Course Content')").hide();


've tried also the else if but but still hidden.


Is there something we can identify by the user enrollment role id and define it by that user role?






hasAnyRole('admin', function (hasRole)




       $("a:contains('Conclude this Course')").show();

       $("a:contains('Export Course Content')").show();


Any help will be appreciated


Fede Arbelaez