mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 10:15:35 +01:00
Update the permission scope (#19603)
1. Update the permission scope 2. Sort the resources and actions by unicode Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
9875965837
commit
d967ac0fb6
@ -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},
|
||||
|
||||
@ -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},
|
||||
@ -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},
|
||||
@ -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},
|
||||
@ -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},
|
||||
},
|
||||
}
|
||||
)
|
||||
|
@ -88,6 +88,8 @@ export class RobotPermissionsPanelComponent
|
||||
this.candidateActions.push(item?.action);
|
||||
}
|
||||
});
|
||||
this.candidateActions.sort();
|
||||
this.candidateResources.sort();
|
||||
}
|
||||
|
||||
isCandidate(resource: string, action: string): boolean {
|
||||
|
@ -162,7 +162,7 @@ class TestRobotAccount(unittest.TestCase):
|
||||
expected_error_message = expected_error_message
|
||||
)
|
||||
|
||||
def Atest_02_SystemlevelRobotAccount(self):
|
||||
def test_02_SystemlevelRobotAccount(self):
|
||||
"""
|
||||
Test case:
|
||||
Robot Account
|
||||
|
Loading…
Reference in New Issue
Block a user