Skip to content

Commit

Permalink
Storage permissions endpoint docs (#4319)
Browse files Browse the repository at this point in the history
* Add docs for storage permisions requests

* add scaladoc
  • Loading branch information
shinyhappydan authored Oct 2, 2023
1 parent eb9fde2 commit 04f5c20
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
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`

0 comments on commit 04f5c20

Please sign in to comment.