crusttech / crust-server

Apache License 2.0
87 stars 21 forks source link

Feature/own rbac implementation #46

Closed mitjaziv closed 5 years ago

mitjaziv commented 5 years ago

Permission API

/rbac/{roleID}
/rbac/546345654363/rules
        POST -> [ APPEND rules
            { object: "messaging:channels:*",  operation: "update", permission: "GRANT" }
            { object: "messaging:channels:1",  operation: "update", permission: "REVOKE" }
            { object: "messaging:channels:2",  operation: "update" } <<<--- removes
            { object: "system",                operation: "organisation.create", permission: "GRANT" }
            { object: "system:organisation:*", operation: "update",           permission: "GRANT" }
            { object: "system:organisation:*", operation: "delete",           permission: "GRANT" }
            { object: "messaging:channel:*",   operation: "update.name",      permission: "GRANT" }
            { object: "messaging:channel:*",   operation: "update.topic",     permission: "GRANT" }
            { object: "messaging:channel:*",   operation: "members.manage",   permission: "GRANT" }
        ]
        GET -> returns all defined permissions for specific role 
        DELETE -> remove all define permissions for specific role

Role functionalities are in former Role API former Team API

titpetric commented 5 years ago

This team - role rename ignores the approach suggested in #34 and reiterated in #45 - as it’s already done I have no objections to the merge, but please keep in mind that this could have been a one line documentation fix instead of a wider codebase refactor (with no discussion).

darh commented 5 years ago

Question: Why remove the scopes endpoint? How do you get available scopes from the API?

this will be handled by the UI.

darh commented 5 years ago

I agree. But POST for rules endpoint is appending (or overriding existing rules)

titpetric commented 5 years ago

Would just changing the method to PATCH be more appropriate then? As it was laid out with resource as the filter, the request was intended to update the complete set of permissions for a resource (or partially if you would only send a subset of modified ones).

On Thu, 21 Feb 2019 at 12:00, Denis Arh notifications@github.com wrote:

I agree. But POST for rules endpoint is appending (or overriding existing rules)

— You are receiving this because your review was requested.

Reply to this email directly, view it on GitHub https://github.com/crusttech/crust/pull/46#issuecomment-465917187, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOPkO_kr0Phx79p4ubo0WDZS6lH2-q1ks5vPmA1gaJpZM4bGy49 .

mitjaziv commented 5 years ago

I agree. But POST for rules endpoint is appending (or overriding existing rules)

POST should be changed to PATCH.