Forums

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

How to get the list of users in confluence who has no access /linked to any of the spaces

Krithica G _EXTERNAL_
Contributor
November 8, 2023

How to get the list of users in confluence who has no access /linked to any of the spaces

 

Currently confluence user group has access to many of the spaces. Through which all licensed users are accessing the space. 

I want to get the list of users who have no access to any space or created any space (excluding the access they have due to confluence user group assignment)

Please let me know how to fetch this?

1 answer

1 vote
Nicolai Sibler
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.
November 9, 2023

Hi @Krithica G _EXTERNAL_ ,

if all access to the spaces is implemented via group assignments and no individual permissions are assigned, this is how it works:


1. list all groups that are permitted in spaces with the following database query:

SELECT 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.spacekey in (select spacekey from spaces s where s.SPACETYPE like 'global')
group by sp.permgroupname
order by sp.permgroupname

2. these groups are listed in another query that shows which users belong to the confluence-users group but not to any of the listed groups you fetched before:

with data as
(select u.lower_user_name, u.first_name, u.last_name, g.group_name, u.email_address
from cwd_user u

join cwd_membership m
on u.id = m.child_user_id

join cwd_group g
on g.id = m.parent_id
order by u.lower_user_name)
select lower_user_name, first_name, last_name, group_name, email_address
from data t
where group_name = 'confluence-users'
and not exists (select *
from data g
where t.lower_user_name = g.lower_user_name
and g.group_name in ('confluence-administrators',
'example_group1',
'example_group2',
'example_group3'))--listed groups

Hope that helps!

Regards,

Nicolai

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.19.7
TAGS
AUG Leaders

Atlassian Community Events