Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the permission scope #19603

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions src/common/rbac/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ var (

{Resource: ResourceReplication, Action: ActionRead},
{Resource: ResourceReplication, Action: ActionCreate},
{Resource: ResourceReplication, Action: ActionDelete},
{Resource: ResourceReplication, Action: ActionList},
{Resource: ResourceReplication, Action: ActionUpdate},

{Resource: ResourceReplicationAdapter, Action: ActionList},

Expand Down Expand Up @@ -145,7 +143,6 @@ var (
{Resource: ResourceLabel, Action: ActionRead},
{Resource: ResourceLabel, Action: ActionCreate},
{Resource: ResourceLabel, Action: ActionDelete},
{Resource: ResourceLabel, Action: ActionList},
{Resource: ResourceLabel, Action: ActionUpdate},

{Resource: ResourceSecurityHub, Action: ActionRead},
Expand All @@ -154,11 +151,7 @@ var (
{Resource: ResourceCatalog, Action: ActionRead},
},
"Project": {
{Resource: ResourceLabel, Action: ActionRead},
{Resource: ResourceLabel, Action: ActionCreate},
{Resource: ResourceLabel, Action: ActionDelete},
{Resource: ResourceLabel, Action: ActionList},
{Resource: ResourceLabel, Action: ActionUpdate},
{Resource: ResourceLog, Action: ActionList},

{Resource: ResourceProject, Action: ActionRead},
{Resource: ResourceProject, Action: ActionDelete},
Expand Down Expand Up @@ -192,7 +185,7 @@ var (

{Resource: ResourceAccessory, Action: ActionList},

{Resource: ResourceArtifactAddition, Action: ActionCreate},
{Resource: ResourceArtifactAddition, Action: ActionRead},

{Resource: ResourceArtifactLabel, Action: ActionCreate},
{Resource: ResourceArtifactLabel, Action: ActionDelete},
Expand All @@ -211,19 +204,23 @@ var (
{Resource: ResourceImmutableTag, Action: ActionList},
{Resource: ResourceImmutableTag, Action: ActionUpdate},

{Resource: ResourceNotificationPolicy, Action: ActionRead},
{Resource: ResourceNotificationPolicy, Action: ActionCreate},
{Resource: ResourceNotificationPolicy, Action: ActionDelete},
{Resource: ResourceNotificationPolicy, Action: ActionList},
{Resource: ResourceNotificationPolicy, Action: ActionUpdate},

{Resource: ResourceTagRetention, Action: ActionRead},
{Resource: ResourceTagRetention, Action: ActionCreate},
{Resource: ResourceTagRetention, Action: ActionDelete},
{Resource: ResourceTagRetention, Action: ActionList},
{Resource: ResourceTagRetention, Action: ActionUpdate},

{Resource: ResourceLog, Action: ActionList},

{Resource: ResourceNotificationPolicy, Action: ActionRead},
{Resource: ResourceNotificationPolicy, Action: ActionCreate},
{Resource: ResourceNotificationPolicy, Action: ActionDelete},
{Resource: ResourceNotificationPolicy, Action: ActionList},
{Resource: ResourceNotificationPolicy, Action: ActionUpdate},
{Resource: ResourceLabel, Action: ActionRead},
{Resource: ResourceLabel, Action: ActionCreate},
{Resource: ResourceLabel, Action: ActionDelete},
{Resource: ResourceLabel, Action: ActionList},
{Resource: ResourceLabel, Action: ActionUpdate},
},
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ export class RobotPermissionsPanelComponent
this.candidateActions.push(item?.action);
}
});
this.candidateActions.sort();
this.candidateResources.sort();
}

isCandidate(resource: string, action: string): boolean {
Expand Down
2 changes: 1 addition & 1 deletion tests/apitests/python/test_robot_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def verify_repository_unpushable(self, project_access_list, system_ra_client, ex
expected_error_message = expected_error_message
)

def Atest_02_SystemlevelRobotAccount(self):
def test_02_SystemlevelRobotAccount(self):
"""
Test case:
Robot Account
Expand Down
Loading