Component Permissions
Is it possible to only show certain components to select user groups?
Ex..
Only "Power users" will be able to see 'Custom Component 1'
thanks,
Within your custom component, you'll need to wrap your content with a freemarker expression that will dictate when to display the content. Use the following links as refrence guides, but i'm imaginging you would write something like...
Using FreeMarker expressions to personalize annoucements and custom components
Context Objects for Custom Components
<#assign user_has_role = false /> <#list restadmin("/users/id/${user.id?c}/roles").roles.role as role> <#if role.name?? && ((role.name == "PowerUser"))> <#assign user_has_role = true /> </#if> </#list> <#if user_has_role > <!-- Content goes here --> <#else> </#if>
However writing your freemarker around premissions instead of roles is preferred because roles can be changed but generally permissions aren't. e.g.: a component for admin and mod users (or anyone else) who has the premission to update the community (orig exmaple and thread here)
<#if coreNode.permissions.hasPermission("update_community")> <!-- Content goes here --> </#if>
Hope that helps.