diff --git a/README.md b/README.md index 6d2ae68..f8f3eac 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,9 @@ Jami API should now be available at http://localhost:3000/. Configure the port f ## API -e.g. `POST /` +`POST /` + +- Body ```json { @@ -29,7 +31,7 @@ e.g. `POST /` } ``` -Response +- Response ```json { @@ -49,8 +51,81 @@ Response } ``` +`GET /:userId` + +- Response + +```json +{ + "id": "hy-hlo-12345678", + "iamGroups": ["hy-employees", "grp-toska"], +} +``` + +`GET /access-to-all` + +- Response + +```json +{ + "500-M009": { + "read": true, + "write": true, + "admin": true + }, + "T920101": { + "read": true, + "write": true, + "admin": true + }, + // ... + "specialGroup": { + "allProgrammes": true + } +} +``` + +`GET /organisation-data` + +- Response: the FACULTIES object from [./src/organisation/faculties.ts](./src/organisation/faculties.ts) + +`GET /all-access` + +- Response: all user's iam groups and their computed access rights: + +```json + [ + { + "id": "hy-hlo-12345678", + "iamGroups": ["hy-employees", "grp-toska"], + "500-M009": { + "read": true, + "write": true, + "admin": true + }, + "T920101": { + "read": true, + "write": false, + "admin": false + }, + "specialGroup": { + "superAdmin": true + } + }, + // ... + ] +``` + +`GET /iam-groups` + +- Response: all unique iam groups in Jami DB: + +```json +["grp-toska", "hy-employees"] +``` + ### Other routes -`GET` `/ping`, `/access-to-all`, `/organisation-data`, `/all-access`, `/iam-groups`, `/:userId` +`GET` `/ping` `POST` `user-organisations` diff --git a/src/organisation/index.ts b/src/organisation/index.ts deleted file mode 100644 index e69de29..0000000