Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

List of page restrictions from DB

Evgeny Boytsov June 1, 2018

Grettings ! I need to get a list of users who have restrictions on accessing the pages in confluence by querying the database. what table does this data contain?

5 answers

1 accepted

5 votes
Answer accepted
Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 1, 2018

The table you are looking for is called CONTENT_PERM.

Column name  | Description
----------------------------------------------------
ID
        | table primary key
CP_TYPE | type of page restriction (View or Edit)
USERNAME | foreign key to the user_mapping table either this or GROUPNAME will be set
GROUPNAMEeither this or USERNAME will be set
CPS_ID | foreign key to the CONTENT table
CREATORforeign key to the user_mapping table
CREATIONDATE | creation date
LASTMODIFIER | foreign key to the user_mapping table
LASTMODDATE | last modification date

Evgeny Boytsov June 6, 2018

Thank you very much ! One more question, please. 

How i can join it to normal view.

Like 

GROUPNAME  | USER 

Is ID`s in table = ID`s in table cwd_user ? 

Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 6, 2018

In the above answer I put in the description section the tables that the foreign keys map to.

Evgeny Boytsov June 6, 2018

@Davin Studer thank a lot ! I did it ! 

Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 6, 2018

Great!

1 vote
Cinnober Admins July 23, 2018

If you are looking for a particular users' restricted pages -  

select * from CONTENT where CONTENTID in ( select CONTENT_ID from CONTENT_PERM_SET where ID in (select CPS_ID from CONTENT_PERM where USERNAME in (select user_key from user_mapping where lower_username like "lower.username")));

1 vote
Tinker Fadoua
Community Champion
June 1, 2018

Hi Theyoba,

Here is the link the the Confluence DB.

I don't see permissions based on pages, it is more space level.

  • Space Group Permissions
  • Space permissions

We have to get space admins used to grant access to pages by group and not by individuals. I am fighting for it right now in my company

1 vote
Mirek
Community Champion
June 1, 2018

Hmm.. why using DB? You can list all restrictions by going to Space Admin > Restricted Pages on each space that you are interested in.

Joel Andrews October 21, 2022

I am looking for a way to list ALL restricted pages in ALL spaces in order to understand what we have to possibly add in an admin group to fix any broken macros post-migration in those restricted pages.

0 votes
Tinker Fadoua
Community Champion
June 1, 2018

User will need to use a join with another table so that he can get the username. Username in CONTENT_PERM table displays as numbers

It shows the group name but not individuals.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events