Hi,
I'm looking for a way to hide/show categories based on user access to spaces.
I have found a way to hide categories for users who are not in certain group:
#if ($userAccessor.hasMembership('confluence-administrators', $helper.action.remoteUser.name))
#else
<script type="text/javascript">
AJS.toInit(function(){
AJS.$('#space-labels-list').hide();
AJS.$('.aui-nav-heading').hide();
});
</script>
#end
Above solution was posted here: https://community.atlassian.com/t5/Confluence-questions/Hide-categories-in-Confluence-page/qaq-p/1169745
But do you know how to hide/show categories based on user access to certain space?
Example:
Space name: A,
Category: nameA
Access: only to userA
Space name: B,
Category: nameB
Access: only to userB
And now if I'am userA I want to see only category nameA because I have an access to space A and if I'am userB I want to see only category nameB because I have an access to space B.
Is there a way to do that using Layouts and by modifying above script?
Regards
--
Seweryn
Hello @Seweryn Szatkowski !
As I understand, you need to hide or show labels within spaces based on user permissions inside Confluence.
If the above is correct, I am unaware on how to proceed with this.
However, if we are talking about actually hiding pages from users who are part of an specific group, we can use page restrictions for this purpose:
You would need to include who can see the content in the restrictions. For example:
- Create page-00
- Put it under categoryA
- Restrict access solely to categoryA members in restrictions
- Create page-01
- Put it under categoryB
- Restrict access solely to categoryB members in restrictions
Now only members of categoryA can see the page under categoryA, no one else. The same goes for categoryB.
Let us hear from you!
Hello @Diego
Thank you very much for your answer. Unfortunately it will not help me because my case is to hide space categories from users who do not have access to spaces under this categories.
I know how to restrict access for pages or spaces but right now even if I restrict access to space for particular group of users, others will be able to see this page category. It is problematic when I use client names as categories and I don't want clients to see each other.
This case is well described in this question:
https://community.atlassian.com/t5/Confluence-questions/Hide-Confluence-Categories/qaq-p/656762
Also there is an open issue for that feature here:
https://jira.atlassian.com/browse/CONFSERVER-43563
Regards
--
Seweryn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.