-
Notifications
You must be signed in to change notification settings - Fork 10
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
UI should check roles/permissions before allow actions to a user #244
Comments
What about having an endpoint e.g.
|
That might work today, but not in the future. As "all" wouldn't be defined if we start adding RBAC, ACL style authorization. |
I don't see why it would not work in the future.
I can not accept a solution that forces the client to call an endpoint multiple times, one for each permission to verify whether or not he is allowed to trigger certain actions. But perhaps I am misunderstanding the proposed solution. It would be nice that for every proposal there is enough details for anyone to read it and clearly know what the technical proposal is and avoid assumptions. |
Assuming you pull in documents into this, trying to answer the question: can user X delete document Y? How would that work? |
For example, the upload. The user has an access token of:
The important part being:
.scope = "… read:document"
. Missingcreate:
orupdate:
scopes. So it's read-only.Still, the UI offers an upload screen, which then fails with a 403.
I think there should be an enpoint in the backend which the UI can use to check if an operation possible for the user. As the scope
read:document
is specific to the keycloak setup. Which translates to theread:advisory
andread:sbom
permission. However, that information/logic is unknown to the client. And differs between different OIDC providers (like AWS cognito).My proposal would be to create an endpoint where the frontend can check if a permission is granted or not. Sending the bearer token and the requested permission. Which are, right now, defined by: https://github.com/trustification/trustify/blob/ed72d871cd9a9d2afe6ce30380d0bbd5edf7b497/common/auth/src/permission.rs#L57-L110
The text was updated successfully, but these errors were encountered: