D4Science D4Science Don't have a D4Science account? Create one Could not find what you are looking for? Contact us.

ACLManager Resource

Manage the Access Control List of shared folders

GET /items/{id}/acls

returns the AccessType for all the users in a shared folder

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
id path id of the shared folder
Response Codes
code condition
200 Shared folder found.
500 This item does not exist.
Response Body
media type data type description
application/json ACLList (JSON)

Example

Request
GET /items/{id}/acls
Content-Type: */*
Accept: application/json
Authorization: ...

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "acls" : [ {
    "accessTypes" : [ "WRITE_ALL", "WRITE_ALL" ],
    "principal" : "..."
  }, {
    "accessTypes" : [ "WRITE_ALL", "ADMINISTRATOR" ],
    "principal" : "..."
  } ]
}
                
              

PUT /items/{id}/acls

Set a new AccessType for a user in a shared folder or VRE folder

Request Parameters
name type description
access form access type
Possible values: READ_ONLY, WRITE_OWNER, WRITE_ALL, ADMINISTRATOR
user form user id
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
id path id of the shared folder
Request Body
media type data type
multipart/form-data (custom)
Response Codes
code condition
204 Access type updated.
400 User does not exist.
415 Wrong content type.
500 This shared item does not exist or wrong access type.
Response Body
media type data type description
application/json object (JSON)

Example

Request
PUT /items/{id}/acls
Content-Type: multipart/form-data
Accept: application/json
Authorization: ...

--------boundaryString
Content-Disposition: form-data; name="user"

user2
--------boundaryString
Content-Disposition: form-data; name="accessType"

WRITE_OWNER
--------boundaryString--

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
...
                
              

GET /items/{id}/acls/write

Check if the current user can write on the shared folder

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
id path id of the shared folder
Response Codes
code condition
200 Shared folder found.
406 This shared folder does not exist.
Response Body
media type data type description
text/plain object true if the current user can write on the shared folder, false otherwise

Example

Request
GET /items/{id}/acls/write
Content-Type: */*
Accept: text/plain
Authorization: ...

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: text/plain

                
true
                
              

DELETE /items/{id}/acls/{user}

Remove a user from the shared folder

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
id path id of the shared folder
user path user id
Response Codes
code condition
204 User removed.
415 Wrong content type.
500 This shared item does not exist.
Response Body
media type data type description
application/json object (JSON)

Example

Request
DELETE /items/{id}/acls/{user}
Content-Type: text/plain
Accept: application/json
Authorization: ...

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
...