Make available a list of User Permissions per Group and Project
Summary
One of our Customer's required a list of permissions for each user, across all groups and projects on their instance.
Currently, a summary of this information isn't readily available
Would it be possible to implement a view or export a file that displays the projects and groups that each user has access to
Additional Information
Relevant Zendesk ticket: https://gitlab.zendesk.com/agent/tickets/30745
cc @JobV
Example scripts given to the customer
require 'csv'
csv_file_path = '/var/tmp/ldap_group_link_export.csv'
begin
rows = [
["Group", "LDAP Group CN", "Access Level"],
*(LdapGroupLink.includes(:group).map do |group_link|
[
group_link.group.name,
group_link.cn,
group_link.human_access
]
end)
]
CSV.open(csv_file_path, "wb") do |csv|
rows.each { |row| csv << row }
end
rescue Exception => e
puts e.message
puts e.backtrace.inspect
end
puts csv_file_path
require 'csv'
csv_file_path = '/var/tmp/groups.csv'
begin
rows = [
["Group", "Description"],
*(Group.all.map do |group|
[
group.name,
group.description
]
end)
]
CSV.open(csv_file_path, "wb") do |csv|
rows.each { |row| csv << row }
end
rescue Exception => e
puts e.message
puts e.backtrace.inspect
end
puts csv_file_path