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?
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
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.