How can I find out to which spaces a users has access?

Patrick_Vanhoof
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.
July 30, 2015

Not only on the user basis, but also via the groups the user belongs to. And if possible, which rights he has on the particular spaces.

Is this a query on the database? If so, can someone give me the SQL to be executed?

 

Thanks!

3 answers

1 vote
Daniel Eads _unmonitored account_
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.
July 31, 2015

SQL queries for you:

SELECT spacename, permtype, permgroupname from spacepermissions
join spaces on spaces.spaceid = spacepermissions.spaceid
where permgroupname = 'GROUP_NAME'
select spacename, permtype, lower_username from spacepermissions
join spaces on spaces.spaceid = spacepermissions.spaceid
join user_mapping on spacepermissions.permusername = user_mapping.user_key
where lower_username = 'jdoe'

And the honker that you're looking for (username is the only value you need to update and it's on the bottom line for your convenience - note that there are two places on that line you need to update it):

SELECT spacename, permtype, permgroupname, lower_username from spacepermissions
LEFT JOIN spaces on spaces.spaceid = spacepermissions.spaceid
LEFT JOIN user_mapping on spacepermissions.permusername = user_mapping.user_key
where (permgroupname IN (select GROUP_NAME from cwd_user u, cwd_group g, cwd_membership m where m.child_user_id = u.id AND m.parent_id = g.id AND
lower_user_name = 'jdoe') OR user_mapping.lower_username = 'jdoe')
1 vote
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
July 31, 2015

This doesn't answer all of your question, but, it is a good way to see and manage overall permissions across your site - getSpacePermissionList. This is part of Confluence Command Line Interface (CLI).

 

Patrick_Vanhoof
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.
July 31, 2015

I'll have a look at it, thanks.

0 votes
Fynn K July 30, 2015

You can just do it in Confluence.
1.Click on the Confluence-Administration Button
2. User Management
3. Type in the name of the user
4. Click Search
5. Click on the Name
6. Groups should be shown in the list

Edit: This is just for the groups, that the user belongs to

Patrick_Vanhoof
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.
July 30, 2015

Fynn, then I know to which groups the user belongs, but not to which spaces the user has access, and which rights he has on these spaces.

Like Chris Rehberg likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events