Merge pull request #13768 from AllForNothing/permission-list

Add new permissions to robot account
This commit is contained in:
Will Sun 2020-12-16 13:30:24 +08:00 committed by GitHub
commit 488d802a2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 83 additions and 18 deletions

View File

@ -32,7 +32,7 @@
{{getPermissions(p.permissions[0].access)}} {{"SYSTEM_ROBOT.PERMISSIONS" | translate}}
<clr-icon shape="caret down"></clr-icon>
</button>
<clr-dropdown-menu clrPosition="bottom-left" *clrIfOpen>
<clr-dropdown-menu [style.height.px]="140" clrPosition="bottom-left" *clrIfOpen>
<div clrDropdownItem *ngFor="let item of p.permissions[0].access" (click)="chooseAccess(item)">
<clr-icon class="check" shape="check" [style.visibility]="item.checked ? 'visible' : 'hidden'"></clr-icon>
<span>{{i18nMap[item.action] | translate}} {{i18nMap[item.resource] | translate}}</span>

View File

@ -9,4 +9,10 @@
}
.datagrid-host {
position: inherit;
}
}
.dropdown-menu {
overflow-y: auto;
}
.dropdown-item {
min-height: 20px;
}

View File

@ -53,6 +53,11 @@ export const INITIAL_ACCESSES: FrontAccess[] = [
"action": "pull",
"checked": true
},
{
"resource": "artifact",
"action": "delete",
"checked": true
},
{
"resource": "helm-chart",
"action": "read",
@ -62,6 +67,31 @@ export const INITIAL_ACCESSES: FrontAccess[] = [
"resource": "helm-chart-version",
"action": "create",
"checked": true
},
{
"resource": "helm-chart-version",
"action": "delete",
"checked": true
},
{
"resource": "tag",
"action": "create",
"checked": true
},
{
"resource": "tag",
"action": "delete",
"checked": true
},
{
"resource": "artifact-label",
"action": "create",
"checked": true
},
{
"resource": "scan",
"action": "create",
"checked": true
}
];
@ -70,9 +100,14 @@ export const ACTION_RESOURCE_I18N_MAP = {
'pull': 'ROBOT_ACCOUNT.PULL',
'read': 'SYSTEM_ROBOT.READ',
'create': 'SYSTEM_ROBOT.CREATE',
'delete': 'SYSTEM_ROBOT.DELETE',
'repository': 'SYSTEM_ROBOT.ARTIFACT',
'artifact': 'SYSTEM_ROBOT.ARTIFACT',
'helm-chart': 'SYSTEM_ROBOT.HELM',
'helm-chart-version': 'SYSTEM_ROBOT.HELM_VERSION'
'helm-chart-version': 'SYSTEM_ROBOT.HELM_VERSION',
'tag': 'REPLICATION.TAG',
'artifact-label': 'SYSTEM_ROBOT.ARTIFACT_LABEL',
'scan': 'SYSTEM_ROBOT.SCAN'
};
export enum ExpirationType {

View File

@ -1626,7 +1626,7 @@
"PROJECTS_MODAL_TITLE": "Projects for Robot Account",
"PROJECTS_MODAL_SUMMARY": "There are the projects covered by this robot account.",
"CREATE_ROBOT": "Create System Robot Account",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover specific projects. Choose \"Cover all projects\" to be applied to all exiting and future projects",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover specific projects. Choose \"Cover all projects\" to be applied to all existing and future projects",
"EDIT_ROBOT": "Edit System Robot Account",
"EDIT_ROBOT_SUMMARY": "Edit a system Robot Account. Choose \"Cover all projects\" to be applied to all exiting and future projects",
"EXPIRATION_TIME": "Expiration time",
@ -1656,6 +1656,9 @@
"SECRET_AGAIN": "Input secret again",
"INCONSISTENT": "Two secrets are inconsistent",
"NAME_TOOLTIP": "Robot name should be 1~255 characters long with lower case characters, numbers and ._- and must be start with characters or numbers.",
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret"
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret",
"DELETE": "Delete",
"ARTIFACT_LABEL": "Artifact label",
"SCAN": "Scan"
}
}

View File

@ -1626,7 +1626,7 @@
"PROJECTS_MODAL_TITLE": "Projects for Robot Account",
"PROJECTS_MODAL_SUMMARY": "There are the projects covered by this robot account.",
"CREATE_ROBOT": "Create System Robot Account",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover specific projects. Choose \"Cover all projects\" to be applied to all exiting and future projects",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover specific projects. Choose \"Cover all projects\" to be applied to all existing and future projects",
"EDIT_ROBOT": "Edit System Robot Account",
"EDIT_ROBOT_SUMMARY": "Edit a system Robot Account. Choose \"Cover all projects\" to be applied to all exiting and future projects",
"EXPIRATION_TIME": "Expiration time",
@ -1656,6 +1656,9 @@
"SECRET_AGAIN": "Input secret again",
"INCONSISTENT": "Two secrets are inconsistent",
"NAME_TOOLTIP": "Robot name should be 1~255 characters long with lower case characters, numbers and ._- and must be start with characters or numbers.",
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret"
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret",
"DELETE": "Delete",
"ARTIFACT_LABEL": "Artifact label",
"SCAN": "Scan"
}
}

View File

@ -1624,7 +1624,7 @@
"PROJECTS_MODAL_TITLE": "Projects for Robot Account",
"PROJECTS_MODAL_SUMMARY": "There are the projects covered by this robot account.",
"CREATE_ROBOT": "Create System Robot Account",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover specific projects. Choose \"Cover all projects\" to be applied to all exiting and future projects",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover specific projects. Choose \"Cover all projects\" to be applied to all existing and future projects",
"EDIT_ROBOT": "Edit System Robot Account",
"EDIT_ROBOT_SUMMARY": "Edit a system Robot Account. Choose \"Cover all projects\" to be applied to all exiting and future projects",
"EXPIRATION_TIME": "Expiration time",
@ -1654,6 +1654,9 @@
"SECRET_AGAIN": "Input secret again",
"INCONSISTENT": "Two secrets are inconsistent",
"NAME_TOOLTIP": "Robot name should be 1~255 characters long with lower case characters, numbers and ._- and must be start with characters or numbers.",
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret"
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret",
"DELETE": "Delete",
"ARTIFACT_LABEL": "Artifact label",
"SCAN": "Scan"
}
}

View File

@ -1594,7 +1594,7 @@
"PROJECTS_MODAL_TITLE": "Projects for Robot Account",
"PROJECTS_MODAL_SUMMARY": "There are the projects covered by this robot account.",
"CREATE_ROBOT": "Create System Robot Account",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover specific projects. Choose \"Cover all projects\" to be applied to all exiting and future projects",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover specific projects. Choose \"Cover all projects\" to be applied to all existing and future projects",
"EDIT_ROBOT": "Edit System Robot Account",
"EDIT_ROBOT_SUMMARY": "Edit a system Robot Account. Choose \"Cover all projects\" to be applied to all exiting and future projects",
"EXPIRATION_TIME": "Expiration time",
@ -1624,6 +1624,9 @@
"SECRET_AGAIN": "Input secret again",
"INCONSISTENT": "Two secrets are inconsistent",
"NAME_TOOLTIP": "Robot name should be 1~255 characters long with lower case characters, numbers and ._- and must be start with characters or numbers.",
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret"
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret",
"DELETE": "Delete",
"ARTIFACT_LABEL": "Artifact label",
"SCAN": "Scan"
}
}

View File

@ -1622,7 +1622,7 @@
"PROJECTS_MODAL_TITLE": "Projects for Robot Account",
"PROJECTS_MODAL_SUMMARY": "There are the projects covered by this robot account.",
"CREATE_ROBOT": "Create System Robot Account",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover specific projects. Choose \"Cover all projects\" to be applied to all exiting and future projects",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover specific projects. Choose \"Cover all projects\" to be applied to all existing and future projects",
"EDIT_ROBOT": "Edit System Robot Account",
"EDIT_ROBOT_SUMMARY": "Edit a system Robot Account. Choose \"Cover all projects\" to be applied to all exiting and future projects",
"EXPIRATION_TIME": "Expiration time",
@ -1652,7 +1652,10 @@
"SECRET_AGAIN": "Input secret again",
"INCONSISTENT": "Two secrets are inconsistent",
"NAME_TOOLTIP": "Robot name should be 1~255 characters long with lower case characters, numbers and ._- and must be start with characters or numbers.",
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret"
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret",
"DELETE": "Delete",
"ARTIFACT_LABEL": "Artifact label",
"SCAN": "Scan"
}
}

View File

@ -1626,7 +1626,7 @@
"PROJECTS_MODAL_TITLE": "Projects for Robot Account",
"PROJECTS_MODAL_SUMMARY": "There are the projects covered by this robot account.",
"CREATE_ROBOT": "Create System Robot Account",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover specific projects. Choose \"Cover all projects\" to be applied to all exiting and future projects",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover specific projects. Choose \"Cover all projects\" to be applied to all existing and future projects",
"EDIT_ROBOT": "Edit System Robot Account",
"EDIT_ROBOT_SUMMARY": "Edit a system Robot Account. Choose \"Cover all projects\" to be applied to all exiting and future projects",
"EXPIRATION_TIME": "Expiration time",
@ -1656,6 +1656,9 @@
"SECRET_AGAIN": "Input secret again",
"INCONSISTENT": "Two secrets are inconsistent",
"NAME_TOOLTIP": "Robot name should be 1~255 characters long with lower case characters, numbers and ._- and must be start with characters or numbers.",
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret"
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret",
"DELETE": "Delete",
"ARTIFACT_LABEL": "Artifact label",
"SCAN": "Scan"
}
}

View File

@ -1653,6 +1653,9 @@
"SECRET_AGAIN": "请再次输入令牌",
"INCONSISTENT": "两次输入不一致",
"NAME_TOOLTIP": "机器人名称由小写字符、数字和._-组成且至少1个字符并以字符或者数字开头。",
"ENABLE_NEW_SECRET": "开启此项以便手动指定新令牌"
"ENABLE_NEW_SECRET": "开启此项以便手动指定新令牌",
"DELETE": "删除",
"ARTIFACT_LABEL": "Artifact 标签",
"SCAN": "扫描"
}
}

View File

@ -1610,7 +1610,7 @@
"PROJECTS_MODAL_TITLE": "Projects for Robot Account",
"PROJECTS_MODAL_SUMMARY": "There are the projects covered by this robot account.",
"CREATE_ROBOT": "Create System Robot Account",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover specific projects. Choose \"Cover all projects\" to be applied to all exiting and future projects",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover specific projects. Choose \"Cover all projects\" to be applied to all existing and future projects",
"EDIT_ROBOT": "Edit System Robot Account",
"EDIT_ROBOT_SUMMARY": "Edit a system Robot Account. Choose \"Cover all projects\" to be applied to all exiting and future projects",
"EXPIRATION_TIME": "Expiration time",
@ -1640,6 +1640,9 @@
"SECRET_AGAIN": "Input secret again",
"INCONSISTENT": "Two secrets are inconsistent",
"NAME_TOOLTIP": "Robot name should be 1~255 characters long with lower case characters, numbers and ._- and must be start with characters or numbers.",
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret"
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret",
"DELETE": "Delete",
"ARTIFACT_LABEL": "Artifact label",
"SCAN": "Scan"
}
}