Skip to content

Commit 1194738

Browse files
authored
Merge pull request #51 from SciCatProject/update-20240408
job authorization updates
2 parents 4fc2a25 + 16ea5c4 commit 1194738

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

Development/v4.x/backend/authorization/authorization_jobs.md

+25-24
Original file line numberDiff line numberDiff line change
@@ -10,62 +10,63 @@ The authorization for jobs is consistently different from all the other endpoint
1010
- JobDelete
1111

1212
### (Data) Instance Authorization
13-
- *job_create_configuration*: the job create section of the configuration dictates if the user can create the job
14-
- JobCreateAny: users with this privileges can create jobs for any of the users that are defined in the create section of the job configuration
13+
- JobCreateConfiguration (The jobs create section of the configuration dictats if the user can create the job)
14+
- JobCreateOwner (Users with this privileges can create jobs only for themselves)
15+
- JobCreateAny (Users with this privileges can create jobs for any of the users that are defined in the create section of the job configuration)
1516
- JobReadAccess
1617
- JobReadAny
17-
- *job_satatus_update_configuration*: the job update section in configuration dictates if the user can update the status of the job
18-
- JobStatusUpdateAny: users with this privileges can update the status of any job.
18+
- JobStatusUpdateConfiguration (The jobs update section in configuration dictates if the user can update the status of the job)
19+
- JobStatusUpdateOwner (Users with this privileges can update the status of jobs belonging to themselves)
20+
- JobStatusUpdateAny (Users with this privileges can update the status of any job)
1921
- JobDeleteAny
2022

2123
#### Priority
2224
```mermaid
2325
graph LR;
24-
JobCreate-->job_create_configuration;
25-
job_create_configuration-->JobCreateAny;
26+
JobCreate-->JobCreateConfiguration;
27+
JobCreateConfiguration-->JobCreateAny;
2628
JobRead-->JobReadAccess;
2729
JobReadAccess-->JobReadAny;
28-
JobStatusUpdate-->job_status_update_configuration;
29-
job_status_update_configuration-->JobStatusUpdateAny;
30+
JobStatusUpdate-->JobStatusUpdateConfiguration;
31+
JobStatusUpdateConfiguration-->JobStatusUpdateAny;
3032
JobDelete-->JobDeleteAny;
3133
```
3234

3335
#### Authorization table
3436
| HTTP method | Endpoint | Endpoint Authentication | Anonymous | Authenticated | Create Jobs Groups | Update Jobs Groups | Admin Groups | Delete Groups | Notes |
3537
| -------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- |
36-
| POST | Jobs | _please see job create<br>authorization table_ | _please see job create<br>authorization table_ | _please see job create<br>authorization table_ | Any<br>_JobsCreateOwner_ | __no__ | Any<br>_JobsCreateAny_ | __no__ | |
37-
| GET | Jobs | _JobRead_ | __no__ | Has Access<br>_JobReadAccess_ | Has Access<br>_JobReadAccess_ | __no__ | Any<br>_JobReadAny_ | __no__ | |
38-
| GET | Jobs/_jid_ | _JobRead_ | __no__ | Has Access<br>_JobReadAccess_ | Has Access<br>_JobReadAccess_ | __no__ | Any<br>_JobReadAny_ | __no__ | |
39-
| POST | Jobs/statusUpdate | _please see job create<br>authorization table_ | __no__ | _please see job update<br>authorization table_ | __no__ | Owner<br>_JobStatusUpdateOwner_ | Any<br>_JobStatusUpdateAny_ | __no__ | |
38+
| POST | Jobs | _JobCreate_ | _JobCreateConfiguration_ | _JobCreateConfiguration_ | Any<br>_JobsCreateOwner_ | __no__ | Any<br>_JobsCreateAny_ | __no__ | |
39+
| GET | Jobs | _JobReadMany_ | __no__ | Has Access<br>_JobReadAccess_ | Has Access<br>_JobReadAccess_ | __no__ | Any<br>_JobReadAny_ | __no__ | |
40+
| GET | Jobs/_jid_ | _JobReadOne_ | __no__ | Has Access<br>_JobReadAccess_ | Has Access<br>_JobReadAccess_ | __no__ | Any<br>_JobReadAny_ | __no__ | |
41+
| POST | Jobs/statusUpdate | _JobStatusUpdate_ | __no__ | _JobStatusUpdateConfiguration_ | __no__ | Owner<br>_JobStatusUpdateOwner_ | Any<br>_JobStatusUpdateAny_ | __no__ | |
4042
| DELETE | Jobs/_jid_ | _JobDelete_ | __no__ | __no__ | __no__ | __no__ | __no__ | _JobDeleteAny_ | |
4143

4244
#### Job Create Authorization Table
43-
These authorization permissions are configured directly in the __*create*__ section of the job configuration.
44-
They apply to the jobs endpoint POST:Jobs
45+
The _JobCreateConfiguration_ authorization permissions are configured directly in the __*create*__ section of the job configuration.
46+
Any positive match will results in the user acquiring _JobCreate_ endpoint authorization which apply to the jobs endpoint POST:Jobs
4547

46-
| Job Create Authorization | Endpoint Authentication | Endpoint Authentication Description | Instance Authentication | Instance Authentication Description |
48+
| Job Create Authorization | Endpoint Authentication Translation | Endpoint Authentication Description | Instance Authentication Translation | Instance Authentication Description |
4749
| --- | --- | --- | --- | --- |
4850
| _#all_ | _#all_ | any user can access this endpoint, both anonymous and authenticated | _#all_ | Any user can create this instance of the job |
49-
| _#admin_ | ADMIN_GROUPS | Only users belonging to any group listed in ADMIN_GROUPS will be able to access the endpoint | ADMIN_GROUPS | Only users belonging to any group listed in ADMIN_GROUPS will be able to create this instance of the job |
50-
| _#authenticated_ | _#user_ | any valid users can access the endpoint, independently from their groups | _#user_ | any valid users can cretae this instance of the job |
5151
| _#datasetPublic_ | _#all_ | any user can access this endpoint, both anonymous and and authenticated | _#datasetPublic_ | the job instance will be created only if all the datasets listed are __public__ |
52+
| _#authenticated_ | _#user_ | any valid users can access the endpoint, independently from their groups | _#user_ | any valid users can cretae this instance of the job |
5253
| _#datasetAccess_ | _#user_ | any valid user can access this endpoint, independently from their groups | _#datasetAccess_ | the job instance will be created only if the user has access to all the datasets listed |
5354
| _#datasetOwner_ | _#user_ | any valid user can access this endpoint, independently from their groups | _#datasetOwner_ | the job instance will be created only if the user is part of all the datasets owner group |
54-
| __*GROUP*__ | __*GROUP*__ | only users that belongs to the specified group can access the endpoint | __*GROUP*__ | the job instance will be created only if all the datasets listed belong to the group specified |
55+
| __*@GROUP*__ | __*GROUP*__ | only users that belongs to the specified group can access the endpoint | __*GROUP*__ | the job instance will be created only if all the datasets listed belong to the group specified |
5556
| __*USER*__ | __*USER*__ | only the specified user can access the endpoint | _#datasetOwner_ | the job instance will be created only if all the datasets listed are owned by any of the user's groups |
5657

5758
__IMPORTANT__: use option _#all_ carefully, as it allows anybody to create a new job. It is mostly use for debuging and testing
5859

5960
#### Job Status Update Authorization Table
60-
These authorization permissions are configured directly in the __*update*__ section of the job configuration.
61-
They apply to the jobs endpoint POST:Jobs/statusUpdate
61+
The _JobStatusUpdateConfiguration_ authorization permissions are configured directly in the __*update*__ section of the job configuration.
62+
Any positive match will results in the user acquiring _JobStatusUpdate_ endpoint authorization apply to the jobs endpoint POST:Jobs/statusUpdate
6263

63-
| Job Status Update Authorization | Endpoint Authentication | Endpoint Authentication Description | Instance Authentication | Instance Authentication Description |
64+
| Job Status Update Authorization | Endpoint Authentication Translation | Endpoint Authentication Description | Instance Authentication Translation | Instance Authentication Description |
6465
| --- | --- | --- | --- | --- |
6566
| _#all_ | _#all_ | any user can access this endpoint, both anonymous and authenticated | _#all_ | Any user can update the status of this job instance |
66-
| _#owner_ | _#user_ | valid user can access the endpoint | _#jobOwner_ | a user that belongs to the group listed as job owner can perform the update |
67-
| _#admin_ | ADMIN_GROUPS | Only users belonging to any group listed in ADMIN_GROUPS will be able to access the endpoint | ADMIN_GROUPS | Only users belonging to any group listed in ADMIN_GROUPS are able to update the job status |
68-
| __*GROUP*__ | __*GROUP*__ | only users that belongs to the specified group can access the endpoint | __*GROUP*__ | the job status can be updated only by users who belong to the group specified |
67+
| _#jobOwnerUser_ | _#user_ | authenticated user can access the endpoint | _#jobOwnerUser_ | only the user that is listed in field _ownerUser_ can perform the update |
68+
| _#jobOwnerGroup_ | _#user_ | authenticated user can access the endpoint | _#jobOwnerGroup_ | any user that belongs to the group listed in field _ownerGroup_ can perform the update |
69+
| __*@GROUP*__ | __*GROUP*__ | only users that belongs to the specified group can access the endpoint | __*GROUP*__ | the job status can be updated only by users who belong to the group specified |
6970
| __*USER*__ | __*USER*__ | only the specified user can access the endpoint | __*USER*__ | the job status can be updated only by the user indicated |
7071

7172
__IMPORTANT__: use option _#all_ carefully, as it allows anybody to update the status of the job. It is mostly use for debuging and testing

0 commit comments

Comments
 (0)