Is there any way to give view permission in confluence to users mentioned on page?
Asked by Evgeniy Buturlia:

Hello! I want to create some user-specific profile pages, and don't want to give permissions to each page separatly.

Is there any option to give view permissions if user is mentioned on page via "@" ?


Answers:
author: Thomas Bowskill
body: [@Evgeniy Buturlia](/t5/user/viewprofilepage/user-id/1172069) not that I know of, as that is the function of Restrictions  

Without knowing the full context, I would suggest try to find the best method that can work around this

Thoughts:

* Sounds like you may want a **Space** for this if you follow the below
* You could increase the people in **Space Permissions** \& allow the people who should grant access the ability to set **Restrictions** so your users can invite others (essentially, the padlock button isn't a huge time-drain to people) -- tell them to log in, hit the padlock and add whoever should be allowed to see the content
* If you have a hierarchy it could help, as Page permissions are inherited (i.e. if you can structure your content so that you only see a child page if you can see the parent -- this applies to **view only** ; you are somewhat limited as the **Edit** permissions are not inherited
* For me, **Groups** have been a godsend: I've started tying our Active Directory groups to Confluence so our firm can re-use permission (but this doesn't sound like a solution to fit the problem you describe)

A bit more on [space permissions to read up on](https://confluence.atlassian.com/doc/space-permissions-overview-139521.html)

comments: author: Evgeniy Buturlia
body: It not even close to the question in summary.

Or maybe you can give an example how it will work with **mentions** ?

I know how permissions and restriction works, I am searching for solution how to set them dynamically based on page context :)


author: Thomas Bowskill
body: It may help knowing what you are trying to achieve, but I'd re-iterate sentence one as your answer to "Is there any option...?": *not that I know of, as that is the function of Restrictions*

Read up on [how Restrictions work](https://confluence.atlassian.com/doc/page-restrictions-139414.html)

What you are effectively asking for is: anyone who can edit the page, has the right to invite others to see it. So they would go on the page, edit it and @ mention the people who should be given access. Opposed to, going on the page, hitting the padlock and typing in the people who should be given access.  

[Access requests could help you?](https://confluence.atlassian.com/doc/page-restrictions-139414.html#PageRestrictions-Getaccesstoarestrictedpage)


author: Evgeniy Buturlia
body: [@Thomas Bowskill](/t5/user/viewprofilepage/user-id/1252132) so, you don't know how to do it **without manually editing** page permission each time mension is being replaced?

Request access can not help me, because I need not only give permissions, but also take them away, automatically.

P.S. Your answer gave an idea: there is a solution with scriptrunner listeners, but it is not easy to implement.


author: Thomas Bowskill
body: Effectively, yes. Although if I had your requirement I would not use the @ mentions and just tell people to manage via restrictions -- so it wouldn't be updating the page permissions when you see a mention; people would directly change the page permission.

Yes, I'm sure you will be able to run scripts -- fundamentally most solutions can be pushed through that way, but the technical overhead rules it out for me. I'm more for seeing if I can give you any alternate ways to tackle this one that don't marry you to script runner (which I would assume would be to scrape the @ mentions on the page and throw them into the Restriction of Can View / Edit?).

We get similar problems with access control and Confluence being in the Financial Services industry: as a product it is very 'open', so the nuances of restricting things aren't bulletproof or as flexible as other products.


author: Stefan Salzl
body: Hi [@Evgeniy Buturlia](/t5/user/viewprofilepage/user-id/1172069)

I know it?s quite an old question but I?m trying to implement the (i guess) same thing:

I want all mentioned users from a page to be permitted to view the page.

So I was thinking of a scriptrunner listener too but I couldn?t figure out how to get a list of all mentioned users yet. Were you able to solve this issue and if so: how?

Thanks in advance.

Best  
Stefan


Tags: confluence-app

confluence-server

server