Open dlabrecq opened 6 years ago
@aslakknutsen do we have an api for this?
No we don't. Yet.
This api will be used to know if you are a collaborator on a space.
Does the current API support these use cases?
What we have now:
That's it. New API will provide endpoints for checking if user is a collaborator for particular space and for getting the list of spaces where user is a collaborator.
And btw, #2 from the list above could actually be used for checking if user is a collaborator in the space or not even now. If it returns 403 then user is not a collaborator.
Is "collaborator" the only useful scope to query for, or should we be providing a more generic api in which you can query the resources for which the user has any specified scope?
I think a generic one that covers everything would work. For more details see #1849.
With the advent of the proposal for the new Permission model (#2068), this is likely going to become a more interesting problem to solve. There will no longer be a a first-class concept of "contributor" in OpenShift.io. Rather, you'll be a user who may have certain Permissions in certain Spaces. So I think this query needs to consider two factors:
Allow
permission in a Space but not the owner? This is the list of "Collaboration Spaces"Note that I'm using the word "Collaboration" loosely here, because there may be Spaces in which I have an explicit Allow
permission in which I am effectively a "read only" user. Some would argue that means I'm something less than a collaborator.
The reason I emphasized explicitly on the last bullet is because Spaces will often grant non-explicit permissions to users. For example, an open-source project grants Reader-type rights to everyone; it does not need to explicitly grant a right to every individual user to do so. In fact, it will likely grant that right to Anonymous/non-authenticated users. However, if, for some reason, that Space explicitly granted me Reader access, the Space would show up on my "Collaboration" list, even though, technically, I do not have any additional rights beyond an non-authenticated user. Of course if the Space were to remove Reader rights from non-authenticated users, I'd still have my Reader right.
I'm in the process of implementing the UXD design below for the my spaces page. https://redhat.invisionapp.com/share/DQDSL22JA#/screens/261389228
There is no API we can use to show which spaces the user is a collaborator. Unfortunately, we have to omit this feature from the new my spaces page.