-
Notifications
You must be signed in to change notification settings - Fork 28
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
Permissions and Roles API #158
Comments
I have a rough draft of the API on my local machine. The consuming side could look like this: pc, _ := pool.GetPermissionssClient("")
checkRes, _ := pc.CheckPermission(ctx, &permissionsv1beta1.CheckPermissionRequest{
Permission: "list-all-spaces",
SubjectRef: &permissionsv1beta1.SubjectReference{
Spec: &permissionsv1beta1.SubjectReference_UserId{
UserId: currentUser.Id,
},
},
}) |
@C0rby can you elaborate on the list of such permissions? If they are only spaces-related, this essentially translates to whether they have resource permissions on the reference they're passing in the request. For example, for the |
It's not only about spaces-related permissions. So our current use case for example is we have a user with the permission Sure we could add this user to all spaces with a special grant but that has some disadvantages. Like if another user or group should also have that permission, we would need to add the other user or group to all existing spaces. Or to revoke the permission from the user we would need to update the grants of all spaces. And when creating new spaces, the grant needs to be added to those too. What this permissions service essentially allows us to do is to implement a role based system where we can create new roles as we like with any collection of permissions and assign it to users or groups. Then we can use this service to check if a user is permitted to do any action without having to change the code for new roles or when roles change. The first role which comes to mind is the
Could you describe how you would implement that? By setting grants on the storage's root node? |
@C0rby @ishank011 will be back next Tuesday to discuss over Zoom as we discussed. |
Great! 👍 |
Here is some code with the proposed changes: CS3 API: #161 @refs and I also wrote down some things which are the result of our zoom meeting and some brainstorming afterwards. tl;drOur proposed changes do not touch the existing Permissions/Grants model. It is meant as an additional system to be able to use an RBAC system. Storage drivers which just abstract other systems like the nextcloud driver do not need to use the permissions API since they communicate to their underlying system using API which already should have permissions checks implemented. (But they can implement and use it if it makes sense) /cc @michielbdejong Storage drivers which will be used as oCIS storage backends MUST use this API in order to behave the same. Proposed solution knowns and gotchas:
|
Cool! As discussed in the Zoom call, just bear in mind that revad can be (and is) used in two ways:
In this latter case, the EFSS will need to know about the permissions too, and hence not all constructs invented at the revad level can be (easily) translated to whatever permission model the existing EFSS system is already using. So the mapping will never be perfect in that case. But we'll find a way to make it come as close as possible! :) |
@michielbdejong In the future we will also have External Permission systems or "policy engines" which will already evaluate permissions. So not only the permissions of existing EFSS is relevant but also external ones. Enterprise EFSS should be able to integrate into existing infrastructure and business workflows of an organisation . |
@michielbdejong let us close this issue here. Feel free to follow-up in a new ticket. |
@labkode I have no permission to close this issue here. |
Closing it since the proposed solution was implemented as a proof of concept. |
Currently in Reva the permissions of a user are stored closely to the file as grants.
Now we want to introduce global permissions which do not belong to a certain resource but allow the user to do things like
Create a new space
oruser has role "admin"
(roles are just a collection of permissions).I want to propose a new simple API to add and list (global) permissions of a user. Although this API could be used to also store resource specific permissions, we would only use it for global permissions for now.
The service would store role and permissions assignments and could answer queries like
has user x the permissions 'create-space'
.@ishank011 @labkode
Did you already think of something like that? Are you against such a service? If not I will create a PR.
/cc @refs
The text was updated successfully, but these errors were encountered: