Skip to content

Commit

Permalink
fix: fix role (#92)
Browse files Browse the repository at this point in the history
Signed-off-by: moweiwei <[email protected]>

Signed-off-by: moweiwei <[email protected]>
  • Loading branch information
moweiwei authored Aug 12, 2022
1 parent a32bbc4 commit 2c65e89
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/core/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const renderMenu = (t) => {
name: t('BackupPoint'),
key: 'backup-point',
level: 1,
module: 'clusters',
module: 'backuppoints',
},
{
path: '/cluster/template',
Expand Down Expand Up @@ -117,7 +117,7 @@ const renderMenu = (t) => {
name: t('LocalRegistry'),
key: '/cluster/local-registry',
level: 1,
module: 'clusters',
module: 'registries',
},
],
},
Expand Down
12 changes: 11 additions & 1 deletion src/locales/basezh.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,15 @@
"DNS Delete": "删除 DNS",
"DNS_DELETE_DESC": "删除 DNS 解析",
"DNS Create": "创建 DNS",
"DNS_CREATE_DESC": "创建 DNS 解析"
"DNS_CREATE_DESC": "创建 DNS 解析",
"Registry View": "查看镜像仓库",
"REGISTRY_VIEW_DESC": "查看平台镜像仓库",
"Registry Edit": "编辑镜像仓库",
"REGISTRY_EDIT_DESC": "编辑平台镜像仓库",
"Cluster Access": "访问 Kubectl",
"CLUSTER_ACCESS_DESC": "连接终端访问 kubectl console",
"BackupPoint View": "查看备份点",
"BACKUPPOINT_VIEW_DESC": "查看集群备份点",
"BackupPoint Edit": "编辑备份点",
"BACKUPPOINT_EDIT_DESC": "编辑集群备份点"
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CreateForm extends ModalAction {

static title = t('Create');

static policy = 'clusters:create';
static policy = 'backuppoints:edit';

get name() {
return t('Create');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class DeleteAction extends ConfirmAction {
return t('Delete BackupPoint');
}

policy = 'clusters:delete';
policy = 'backuppoints:edit';

onSubmit = (item) => {
const { name } = item;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/cluster/containers/BackupPoint/actions/Edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Edit extends ModalAction {

static title = t('Edit BackupPoint');

static policy = 'clusters:edit';
static policy = 'backuppoints:edit';

static allowed = () => Promise.resolve(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ export default class LinkAddPlugin extends LinkAction {
return `/cluster/add-plugin/${item.name}`;
}

policy = 'clusters:edit';
static policy = 'clusters:edit';
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ export default class LinkAddStorage extends LinkAction {
return `/cluster/add-storage/${item.name}`;
}

policy = 'clusters:edit';
static policy = 'clusters:edit';
}
2 changes: 2 additions & 0 deletions src/pages/cluster/containers/Cluster/actions/Terminal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export default class ConnectTerminal {

static isRunning = (item) => item.status === 'Running';

static policy = 'clusters:access';

static allowed = (item) => Promise.resolve(this.isRunning(item));

static openTerminal = async (val) => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/cluster/containers/LocalRegistry/actions/Add.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Add extends ModalAction {

static title = t('Add');

static policy = 'platform:edit';
static policy = 'registries:edit';

get name() {
return t('Add');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class DeleteAction extends ConfirmAction {
return t('Delete Registry');
}

policy = () => 'platform:edit';
policy = () => 'registries:edit';

onSubmit = (_, __, props) => {
const datas = toJS(store.list.data);
Expand Down

0 comments on commit 2c65e89

Please sign in to comment.