Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,761
    • Issues 44,761
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,330
    • Merge requests 1,330
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #1772
Closed
Open
Issue created Jul 22, 2016 by Mark Fletcher@markglenfletcher🔴Contributor0 of 2 checklist items completed0/2 checklist items

Make available a list of User Permissions per Group and Project

Problem to solve

Its cumbersome to culminate a list of permissions for each user, across all groups and projects on their instance. Currently, there is no summary available to see this information and as a work around customers are using a script to generate the data view they need.

Solution

  • Add an export button ⬆️ (generates the same type of report as the script below)
  • Use icon only buttons, and use the button text in the tooltip instead 💡
Current 🆕
Current Proposal

Example Output

Username Email Type Path Access Level Inherited memberships
root admin@example.com Group gitlab-org Owner gitlab-org/subgroup-one, gitlab-org/subgroup-one/gitlab-test

Technical Implementation

backend - 5

  1. Create Service to generate csv file
  2. Create api to download the resultant csv file

frontend - 1

  1. Add new icon for csv export
  2. Email template

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

Additional Information

Relevant Zendesk ticket: https://gitlab.zendesk.com/agent/tickets/30745

cc @JobV

Edited Mar 31, 2021 by Aishwarya Subramanian
Assignee
Assign to
Time tracking