Skip to content

Commit

Permalink
fixed: job assignee can remove or update any issue created by the tas…
Browse files Browse the repository at this point in the history
…k owner #4424
  • Loading branch information
k1won committed Mar 10, 2022
1 parent 42fdea9 commit 3370d88
Show file tree
Hide file tree
Showing 4 changed files with 5,736 additions and 5,730 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Permission error occured when accessing the JobCommits (<https://github.com/openvinotoolkit/cvat/issues/4434>)
- job assignee can remove or update any issue created by the task owner (<https://github.com/openvinotoolkit/cvat/issues/4424>)

### Security
- TDB
Expand Down
8 changes: 4 additions & 4 deletions cvat/apps/iam/rules/issues.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ view,Issue,Sandbox,"Project:owner, Project:assignee, Task:owner, Task:assignee,
view,Issue,Organization,N/A,,GET,/issues/{id},User,Maintainer
view,Issue,Organization,"Project:owner, Project:assignee, Task:owner, Task:assignee, Job:assignee, Owner, Assignee",,GET,/issues/{id},None,Worker
update,Issue,Sandbox,N/A,,PATCH,/issues/{id},Admin,N/A
update,Issue,Sandbox,"Project:owner, Project:assignee, Task:owner, Task:assignee, Job:assignee, Owner",,PATCH,/issues/{id},Worker,N/A
update,Issue,Sandbox,"Project:owner, Project:assignee, Task:owner, Task:assignee, Owner",,PATCH,/issues/{id},Worker,N/A
update,Issue,Organization,N/A,,PATCH,/issues/{id},User,Maintainer
update,Issue,Organization,"Project:owner, Project:assignee, Task:owner, Task:assignee, Job:assignee, Owner",,PATCH,/issues/{id},Worker,Worker
update,Issue,Organization,"Project:owner, Project:assignee, Task:owner, Task:assignee, Owner",,PATCH,/issues/{id},Worker,Worker
delete,Issue,Sandbox,N/A,,DELETE,/issues/{id},Admin,N/A
delete,Issue,Sandbox,"Project:owner, Project:assignee, Task:owner, Task:assignee, Job:assignee, Owner",,DELETE,/issues/{id},Worker,N/A
delete,Issue,Sandbox,"Project:owner, Project:assignee, Task:owner, Task:assignee, Owner",,DELETE,/issues/{id},Worker,N/A
delete,Issue,Organization,N/A,,DELETE,/issues/{id},User,Maintainer
delete,Issue,Organization,"Project:owner, Project:assignee, Task:owner, Task:assignee, Job:assignee, Owner",,DELETE,/issues/{id},Worker,Worker
delete,Issue,Organization,"Project:owner, Project:assignee, Task:owner, Task:assignee, Owner",,DELETE,/issues/{id},Worker,Worker
8 changes: 6 additions & 2 deletions cvat/apps/iam/rules/issues.rego
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,17 @@ is_job_staff {
}

is_issue_admin {
is_job_staff
is_task_staff
}

is_issue_admin {
is_issue_owner
}

is_issue_staff {
is_job_staff
}

is_issue_staff {
is_issue_admin
}
Expand Down Expand Up @@ -234,7 +238,7 @@ allow {
allow {
{ utils.UPDATE, utils.DELETE }[input.scope]
input.auth.organization.id == input.resource.organization.id
is_issue_admin
utils.has_perm(utils.WORKER)
organizations.is_member
is_issue_admin
}
Loading

0 comments on commit 3370d88

Please sign in to comment.