How to check permissions for a specific page via SQL queries
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Purpose
It may be helpful to check the permissions of a specific page to verify what is being reported in the UI or an administrator may want to generate this information from the database for reporting purposes
Solution
The below query will give an output of all permissions on a given page. Just replace <page title here>
with your exact page title
Postgres query
SELECT u.username , c.cp_type , c.creationdate , c.lastmoddate
FROM content_perm AS c
JOIN user_mapping AS u
ON c.username = u.user_key
WHERE c.cps_id in (SELECT id FROM content_perm_set WHERE content_id in (SELECT contentid FROM content WHERE title= '<page title here>'
ORDER BY version DESC LIMIT 1));
MySQL query
SELECT u.username , c.cp_type , c.creationdate , c.lastmoddate
FROM CONTENT_PERM AS c
JOIN user_mapping AS u
ON c.username = u.user_key
WHERE c.cps_id in (SELECT id FROM CONTENT_PERM_SET WHERE content_id in (SELECT contentid FROM CONTENT WHERE title= '<page title here>'));