How to get space permissions of all spaces for specific user groups

プラットフォームについて: Data Center のみ。 - This article only applies to Atlassian apps on the Data Center プラットフォーム

この KB は Data Center バージョンの製品用に作成されています。Data Center 固有ではない機能の Data Center KB は、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。 Server* 製品のサポートは 2024 年 2 月 15 日に終了しました。Server 製品を実行している場合は、 アトラシアン Server サポート終了 のお知らせにアクセスして、移行オプションを確認してください。

*Fisheye および Crucible は除く

要約

The steps outlined in this article are provided AS-IS. This means we've had reports of them working for some customers, under certain circumstances, yet they are not officially supported, nor can we guarantee they'll work for your specific scenario.

You may follow through and validate them on your own non-prod environments prior to production, or fall back to supported alternatives if they don't work out.

We also invite you to contact our Community for matters that are outside Atlassian's scope of support!

Database query to get details about space permissions of all the spaces in Confluence for a specific set of user groups.

ソリューション

Warning: Backup your database before proceeding.

Before running any SQL in this article, create a full backup of your Jira database. Test the queries in a staging environment first if possible.

注意

These database queries are tested on PostgreSQL Database

  • Below are all possible space permissions which can be given for space, to a user/users or to a group/groups

The types of space permissions for spaces

permtype --------------------- SETSPACEPERMISSIONS EXPORTSPACE VIEWSPACE SETPAGEPERMISSIONS REMOVEBLOG REMOVEPAGE EDITSPACE CREATEATTACHMENT REMOVEOWNCONTENT COMMENT REMOVECOMMENT EDITBLOG REMOVEMAIL REMOVEATTACHMENT
  • When you have to check space permissions of all the spaces in confluence for a specific set of user groups

  • You need to replace '<group1>', '<group2>' with the groups from your environment, in the below query:

    • Database query to check permissions for both groups for all spaces

      PostgreSQL

      SELECT distinct sp.permtype FROM SPACEPERMISSIONS sp JOIN SPACES s ON sp.spaceid = s.spaceid LEFT JOIN user_mapping um ON sp.permusername = um.user_key WHERE sp.permgroupname IN ('<group1>', '<group2>');
  • When you have to check space permissions of one space for two groups

  • You need to replace '<group1>', '<group2>' with the groups from your environment and the '<spacename>' as per your requirement, in the below query:

    • Database query to check space permissions of one space for two groups

      PostgreSQL

      SELECT sp.permid, sp.permtype, s.spacekey, s.spacename, sp.permgroupname FROM SPACEPERMISSIONS sp JOIN SPACES s ON sp.spaceid = s.spaceid LEFT JOIN user_mapping um ON sp.permusername = um.user_key WHERE s.spacename = '<spacename>' and sp.permgroupname IN ('<group1>', '<group2>');
  • When you have to check the space permissions of all the personal spaces for groups , this query will check permissions for personal spaces only.

  • You need to replace '<group1>', '<group2>' with the groups from your environment, in the below query:

    • Database query to check the permissions for ALL of the personal space for groups - "'<group1>', '<group2>'"

      PostgreSQL

      SELECT * FROM SPACEPERMISSIONS AS SP ,SPACES AS S WHERE SP.SPACEID=S.SPACEID AND S.SPACETYPE='personal' AND SP.PERMGROUPNAME IS NOT NULL AND SP.PERMGROUPNAME IN ('<group1>', '<group2>');
更新日時: September 25, 2025

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。