How to enable links for non-logged in Confluence users?

I use Confluence for a subscription-based web site, and at present if users aren't logged in any links to subscriber content are disabled. This is sometimes confusing for my non-logged in users. I would like to enable the links at all times so the users are prompted to log in when necessary. Is this possible?

Thanks,

Dave

2 answers

1 accepted

This widget could not be displayed.

While not the idea solution, the following is the best option I've come up with so far. I added the following Javascript in Custom HTML at the end of the page. It looks for URLs that end in # (Confluence's convention for hiding inaccessible URLs) and replaces them with one of two publicly-accessible pages on my site, depending on whether or not the user is logged in.

<script type="text/javascript">
AJS.toInit(function ($) {
        for (var ls = document.links, numLinks = ls.length, i=0; i<numLinks; i++){
            if (!!ls){
	        var l = ls[i].href;
                if (l.indexOf("#") + 1 == l.length){
                    if (AJS.params.remoteUser == ''){
                        ls[i].href= "insert login-required URL here";
                    } else {
                        ls[i].href= "insert not-covered-by-subscription URL here";
                    }
                }
            }
        }
});
</script>

This widget could not be displayed.

Hi Dave,

I believe you can achieve that by enabling a space to be accessed by anonymous users.

In order to set a space to be accessible by anonymous user, you need to login as confluence admin, then click on Space Tool > Permission. In Anonymous access section you click on Edit Permissions and then you can select the permission as required.

Or if you want your whole site to be accessible by anonymous users you can set your Confluence to do so too.

You might find the following document usefull:

https://confluence.atlassian.com/display/DOC/Setting+Up+Public+Acces

Hope it helps.

Ah, but that's just the problem. I don't want subscriber-only spaces to be accessible by anonymous users, but I want anonymous users to see real links so that when they click on those links they're prompted to log in.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

509 views 7 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you