Skip to content
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

Storage permissions endpoint docs #4319

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import ch.epfl.bluebrain.nexus.delta.sdk.permissions.model.Permission
import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef
import monix.bio.UIO

/**
* Provides the permission a user needs to have in order to access files on this storage
*/
trait StoragePermissionProvider {

def permissionFor(id: IdSegmentRef, project: ProjectRef, accessType: AccessType): UIO[Permission]
Expand Down
27 changes: 19 additions & 8 deletions docs/src/main/paradox/docs/delta/api/user-permissions-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,31 @@ The described endpoints are experimental and the responses structure might chang

@@@

## Head
Requests
: All requests should have no body

This operation determines whether the current logged in user has a specific permission in a specific context
Responses
: A response will have a 204 (no content) status code if the user is authorised
: A response will have a 403 (forbidden) status code if the user is not authorised


## Standard permissions

This operation determines whether the current logged in user has a specific permission in a specific context
```
HEAD /v1/user/permissions/{org_label}/{project_label}?permission={permission}
```

where
- `{permission}`: String - the permission to check

Request
: The request should have no body

Response
: The response will have a 204 (no content) status code if the user is authorised
: The response will have a 403 (forbidden) status code if the user is not authorised
## Storage access permissions

This operation determines whether the current logged in user would be able to access files on a specific storage
```
HEAD /v1/user/permissions/{org_label}/{project_label}?storage={storage_id}&type={access_type}
```
where
- `{storage_id}`: String - the id of the storage
- `{access_type}`: String - the access type of the storage. Can be `read` or `write`