-
Notifications
You must be signed in to change notification settings - Fork 186
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
Add http endpoint to list permissions #5571
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
we agreed to implement listing permissions instead ... |
8aa81eb
to
25fc362
Compare
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Perfect! That's exactly what we need for web. Regarding some of your optional todos:
Agree to not do this. Web ui needs the
Permission ids are not relevant for web. Checking permissions by name is sufficient and also provides better developer experience (code readability wise).
YES! Thank you! ❤️ cc @JammingBen |
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
c90c956
to
ea8d0f7
Compare
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Kudos, SonarCloud Quality Gate passed! |
Author: Jörn Friedrich Dreyer <[email protected]> Date: Wed Feb 15 14:24:19 2023 +0100 Add http endpoint to list permissions (#5571) * Add http endpoint to list permissions Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * extract handler registration Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * use generated protobuf Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * update permissions mock in graph service Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * add unit test Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * return correct userid Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * assert error message type in tests Signed-off-by: Jörn Friedrich Dreyer <[email protected]> --------- Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Author: Jörn Friedrich Dreyer <[email protected]> Date: Wed Feb 15 14:24:19 2023 +0100 Add http endpoint to list permissions (#5571) * Add http endpoint to list permissions Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * extract handler registration Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * use generated protobuf Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * update permissions mock in graph service Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * add unit test Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * return correct userid Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * assert error message type in tests Signed-off-by: Jörn Friedrich Dreyer <[email protected]> --------- Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
This PR adds an http endpoint to list permission names.
Can be tested with curl:
will return a 200 Ok:
will return a 200 Ok like:
Trying to look up the permissons of a user other than the currently logged in user:
will give a 404 with json body
even for administrators, as I want to keep this minimal.
Now, we could polish this, eg:
return a parseable json error ... but none of the settings apis seem to do that anyway ...allow admins to look up othe users permissions, but currently there is no reason to do thatnot neededreturn permissions asnot needed{"permissionid": "name"}
map, but I think that does not any value, especially since permissions might be added dynamicallyGood so far?