-
Notifications
You must be signed in to change notification settings - Fork 1
administration
-
Reference: https://iiif.library.utoronto.ca/presentation/v2/#!/Administration/RegisterPostAdmin
-
The API supports two levels of User management.
-
Admin User
-
Staff User
- Admin users have full access to perform any authenticated requests on any objects in the database. These include
POST,PUTandDELETE. - In order to create a new admin user, a
POSTrequest must be sent to/auth/adminalong with the required params in the body (username,email,passwordandsecretKey). The value for thesecretKeyis defined in the API settings and must be kept secret from public view. - Apart from performing actions on objects, admin users can create/update/delete accounts for
Staffusers.
- Staff users have full access to perform any authenticated requests on any objects that they own. This is identified by the internal property
ownedByin an object. A newly created object will have the staff user who sent the request as the owner. AdditionalPUTandDELETErequests on that object can only be performed by that staff user.
- Reference: https://iiif.library.utoronto.ca/presentation/v2/#!/Administration/UpdatePermission
- Each object has a
belongsTofield which is a list of staff usernames who havePOST,PUTandDELETEaccess to that object. - In order to update all children objects under a Collection or Manifest, an
adminuser can perform aPUTrequest to/auth/admin/updatePermissionwith the following body.
{
"collections": [
"http://localhost:8000/collections/anatomia",
"http://localhost:8000/collections/insulin"
],
"manifests": [
"http://localhost:8000/anatomia:RBAI001/manifest",
"http://localhost:8000/anatomia:RBAI002/manifest"
],
"username": "NEW STAFF",
"action": "ADD"
}- This would add the
NEW STAFFto the existing list of usernames under each of the given Collections and Manifests recursively to its children too. - In order to remove a username, a request must be sent with the value of
actionbeingREMOVEinstead ofADD. - NOTE: The list in
collectionswill only update its sub-collections and manifests. It won't update any of its sub-collection's manifests.
-
How to share an object with multiple staff users ?
-
An admin user can update the object which multiple staff users wants to share by performing a
PUTfor that object and updating theownedByinternal field. TheownedByis a list of staffusernameswho have authenticated access to that object. -
How to block access to an object from all staff users ?
-
An admin user can update the
ownedByfield to be an empty list. This will make the object editable only by an admin user. -
How to view all objects owned by a specific staff user ?
-
This can be achieved by sending a search query to the object.
-
(eg): To view all manifests that a staff user has permissions,
/search/manifest/?ownedBy%3Dstaffusername. This would result in a list of manifests.