Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List repo access for user #176

Open
snomos opened this issue Mar 11, 2023 · 4 comments
Open

List repo access for user #176

snomos opened this issue Mar 11, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@snomos
Copy link
Member

snomos commented Mar 11, 2023

gut show user USERNAME should list all repos USERNAME has access to, and for each repo the highest level of access. -o and -r work as usual.

The resulting list should be sorted alphabetically, but run asynchronously for fastest operation. A similar functionality is found in gh for a single repo, e.g.:

gh api repos/ORGANISATION/REPONAME/collaborators/USERNAME/permission
@snomos snomos added the enhancement New feature or request label Mar 11, 2023
@snomos
Copy link
Member Author

snomos commented Mar 12, 2023

List also matching repositories the specified user does not have access to, if visible to the invoking user.

@snomos
Copy link
Member Author

snomos commented Mar 12, 2023

It should be possible to specify multiple users as a comma separated list

@snomos
Copy link
Member Author

snomos commented Mar 13, 2023

Instead of user(s), one could specify a team.

@snomos
Copy link
Member Author

snomos commented Mar 13, 2023

Output could be something like the following (cf output from other actions):

$ gut show user rueter,snomos -r ^lang-sm -o giellalt
+---------------------------------------------------+
| Repo                        User     Access level |
+===================================================+
| lang-sma                    rueter   write        |
|                             snomos   admin        |
| lang-sme                    rueter   write        |
|                             snomos   admin        |
| lang-smj                    rueter   write        |
|                             snomos   admin        |
| lang-smn                    rueter   write        |
|                             snomos   admin        |
| lang-sms                    rueter   write        |
|                             snomos   admin        |
+---------------------------------------------------+

When looking at this, it might be better to sort on user first, then repo, so that instead it becomes:

$ gut show user rueter,snomos -r ^lang-sm -o giellalt
+---------------------------------------------------+
| Repo                        User     Access level |
+===================================================+
| lang-sma                    rueter   write        |
| lang-sme                    rueter   write        |
| lang-smj                    rueter   write        |
| lang-smn                    rueter   write        |
| lang-sms                    rueter   write        |
+---------------------------------------------------+
| lang-sma                    snomos   admin        |
| lang-sme                    snomos   admin        |
| lang-smj                    snomos   admin        |
| lang-smn                    snomos   admin        |
| lang-sms                    snomos   admin        |
+---------------------------------------------------+

That is much easier to read.

For teams, just replace User with Team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant