Granting access to anonymous users, but not allowing them to see all spaces?
Asked by Neil Adams:

I am currently working with a department in our company to create a tutorial/knowledge-base style space for certain users. These users are not a part of our company, so we have it restricted to "view" only for anonymous users. However, on the page in the left hand column, they can click the name of the space, hit all spaces, and see all of the "anonymous" access spaces. Is there a way to have that not happen, as there are some tutorials that don't need to be seen by certain users.

Thank you!

Neil


Answers:
author: Igor M.
body: Hey,

There is no way to restrict anonymous space to a certain group of anonymous users as there is no unique identification factor for them, but you can hide the space directory link using CSS and JavaScript as outlined in [How to hide elements in Confluence using CSS or JavaScript](https://confluence.atlassian.com/confkb/how-to-hide-elements-in-confluence-using-css-or-javascript-313458894.html) guide.

So you will not necessarily limit a user to only be able to see one space, but you will take away the ability to switch to another space unless they have a direct link to that space or know a space name and modify URL. Adding this to Custom HTML seems to do the trick:

```
<script>
 AJS.toInit(function(){
 if (AJS.params.remoteUser == ''){
 AJS.$("#space-menu-link").hide();
 }
 });
</script>
```

comments: author: Neil Adams
body: Thank you! I will give that a try.


author: Nic Brough -Adaptavist-
body: An anonymous user can only see the spaces that allows anonymous access.

You can't hide an anonymously accessible space from an anonymous user, that's a flat out contradiction. They're anonymous and you've told Confluence that anonymous users can see the space.

comments: author: Neil Adams
body: Correct.

The way I was seeing it though was they would have access to only the space we sent them the link to, not every anonymous space we have. They would only need to see the one space, not all 5.

Think of Vimeo, you can have a bunch of private videos with their own link. You send the link out to one of the private videos, but that doesn't allow them to see all of the private videos. The spaces are the same. They each have their own link, but they can click to view "all spaces." I don't see that as being a contradiction, because I only want them to see the space I sent them.


author: Nic Brough -Adaptavist-
body: No, you've misunderstood what Vimeo is doing. First, each video translates to a space in its own right, but secondly and more to the point, the access is done with a shared "secret" (that can be worked out). It's **not** anonymous access, the link is the identifying login for a user.


author: Neil Adams
body: Okay. This is straying way off my original question.

Is there a way for anonymous user to **only** see the space I send them the link to and not **all**of our anonymous spaces? The concept doesn't seem difficult and am surprised it's not a default setting.


author: Nic Brough -Adaptavist-
body: No. Have a think about the word "anonymous". You can not identify a truly anonymous person/process/computer/etc, that is what anonymous means. Your setup is literally "I do not know who you are, so you can see any space with the 'I do not know who you are' flag set". This is not a difficult concept at all.

If you want someone to be able to see stuff that you don't want other people to see then you need to know (in a broad sense) who they are. You need to provide them with something that identifies them as someone who can see stuff other people cannot. For a lot of cases, this is a simple form of identity (username/password for example), and in the rest, it's some form of pass, token, key or whatever. Vimeo does it with a key. But that key identifies the use of the access, it is not the same thing as "anonymous".