Wondering if there is an easier way to do something.
I have the calendar module from Solspace installed. One member group should only be able to access one calendar, and the other group - both of them. The calendar module doesn’t consider member group access and restrictions, either you have access to the channel or not. So I am using CP JSS & JS to to remove one calendar, which is easy.
$(function(){
$('#calendar_select select option[value="4612"]').remove();
});But I want to add a conditional based on user login
$(function(){
if ($member_group != 8) {
$('#calendar_select select option[value="4612"]').remove();
}
});Something like that, but I am wondering if there is an easy way to access the member_group variable or member_id via jquery. Does EE have a library available already? If not, what is a good suggestion on how to do this within the control panel.
I know for the front end I could just use the {member_group} tag within an id or class, and I can use that for a variable. I don’t want to hack any front end cp template files doing that. any ideas?
EE v2.3.1
Calendar 1.6.3