Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Added support to redefine users of a repository #166

Merged
merged 1 commit into from
Sep 10, 2014

Conversation

ricardodani
Copy link
Contributor

Thanks, @scorphus :)

@@ -64,6 +64,7 @@ func SetupRouter() *pat.Router {
router.Post("/user", http.HandlerFunc(newUser))
router.Delete("/user/{name}", http.HandlerFunc(removeUser))
router.Delete("/repository/revoke", http.HandlerFunc(revokeAccess))
router.Put("/repository/set", http.HandlerFunc(setAccess))
Copy link
Contributor

Choose a reason for hiding this comment

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

What about grant instead of set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A route called repository/grant already exists and its purpose is different of set.
grant method just append new users to the list of users, ignoring the already existing users
revoke does the reverse, but also ignores the others too.
The set method, forces the users list to be the same as the users argument. Reseting all the user array. This method is important to garantee a correct updating permission flux in-one-action that normally will be implemented with revoke and grant methods, and can be dangerous if one of them does not works for some reason.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, that makes sense. Thanks for clarifying!

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that instead "set" we should just create a route to change/update the repository attributes. A put in repository.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense. I agree. There's already a PUT in repository/:name that serves such a purpose – renaming a repository. Perhaps we should extend it and support changing Users, ReadOnlyUsers and IsPublic attributes too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See #167

fsouza added a commit that referenced this pull request Sep 10, 2014
Added support to redefine users of a repository
@fsouza fsouza merged commit e2500d6 into tsuru:master Sep 10, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants