Created
August 27, 2014 18:50
-
-
Save phette23/2d82254d6f8a413ba9e4 to your computer and use it in GitHub Desktop.
EQUELLA - Expose User Role to JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#-- NOTE this style should be removed for home page portlet | |
also should really use an ID rather than hide all portlet headings --> | |
<style> | |
/* hide header */ | |
.portlet_freemarker_content .box_title_wrapper h3 { | |
display: none !important; | |
} | |
</style> | |
<#-- these role IDs will need to be researched & changed --> | |
<#if user.hasRole('490b1b93-10cd-b8fa-3291-93c357efe57b')> | |
<#assign role = 'faculty'> | |
<#elseif user.hasRole('c8038af0-fa3f-9a70-e5e1-3f768972203a')> | |
<#assign role = 'staff'> | |
<#elseif user.hasRole('89ea364f-066e-1a3f-f70e-4b29f08e8448')> | |
<#assign role = 'student'> | |
<#else> | |
<#assign role = 'public'> | |
</#if> | |
<#if role != 'public'> | |
<script>window._ccaRole = '${role}';</script> | |
<#-- whole portlet goes in here | |
isn't accessible to public users --> | |
</#if> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment