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

feat(repo): add repo permissions for teams #569

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

haarchri
Copy link
Member

@haarchri haarchri commented Jun 23, 2024

Description of your changes

uses upbound/up-sdk-go#94
add repo permission to grant teams permissions

Fixes #

I have:

  • Read and followed Upbound's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR, as appropriate.

How has this code been tested

up repo permission list test123 -a upboundcare                                                
TEAM      REPOSITORY                                 PERMISSION   CREATED                UPDATED
test123   function-conditional-patch-and-transform   write        2024-06-25T06:23:17Z   n/a
up repo permission revoke test123 function-conditional-patch-and-transform -a upboundcare
Are you sure you want to revoke the permission for team "test123" in repository "function-conditional-patch-and-transform"? This cannot be undone [y/n]: y
Revoking repository permission for team "test123" in repository "function-conditional-patch-and-transform"
Repository permission for team "test123" in repository "function-conditional-patch-and-transform" revoked
up repo permission grant test123 function-conditional-patch-and-transform write -a upboundcare
Permission "write" granted to team "test123" for repository "function-conditional-patch-and-transform" in account "upboundcare"

@haarchri
Copy link
Member Author

needs update after sdk is up2date for upbound/up-sdk-go#94

cmd/up/repository/repository.go Outdated Show resolved Hide resolved
cmd/up/repository/permission/permission.go Outdated Show resolved Hide resolved
cmd/up/repository/permission/list.go Outdated Show resolved Hide resolved
cmd/up/repository/permission/create.go Outdated Show resolved Hide resolved
cmd/up/repository/permission/create.go Outdated Show resolved Hide resolved
cmd/up/repository/permission/create.go Outdated Show resolved Hide resolved
cmd/up/repository/permission/create.go Outdated Show resolved Hide resolved
@haarchri haarchri marked this pull request as ready for review June 24, 2024 05:51
@haarchri haarchri requested a review from turkenh June 24, 2024 06:14
cmd/up/repository/permission/permission.go Outdated Show resolved Hide resolved
cmd/up/repository/permission/list.go Outdated Show resolved Hide resolved
cmd/up/repository/permission/delete.go Outdated Show resolved Hide resolved
cmd/up/repository/permission/delete.go Outdated Show resolved Hide resolved
cmd/up/repository/permission/create.go Outdated Show resolved Hide resolved
Copy link
Member

@adamwg adamwg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

return nil
}

confirm, err := c.prompter.Prompt(fmt.Sprintf("Are you sure you want to revoke the permission for team %q in repository %q? This cannot be undone [y/n]", c.TeamName, c.RepositoryName), false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"This cannot be undone" is a little strong :-) The permission can always be re-granted, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah same for all other resources ;) let's do this rename in a seperate PR

@haarchri haarchri merged commit 61b7eb4 into upbound:main Jun 26, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants