Skip to content

Commit

Permalink
A 添加角色的文件分发权限管理
Browse files Browse the repository at this point in the history
  • Loading branch information
vapao committed Jul 19, 2022
1 parent 33411ae commit 30c3712
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spug_api/apps/exec/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


class TransferView(View):
@auth('exec.task.do')
@auth('exec.transfer.do')
def get(self, request):
records = Transfer.objects.filter(user=request.user)
return json_response([x.to_view() for x in records])
Expand Down
2 changes: 1 addition & 1 deletion spug_web/src/pages/exec/transfer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function TransferIndex() {
setFiles([...files])
}

return (<AuthDiv auth="exec.task.do">
return (<AuthDiv auth="exec.transfer.do">
<Breadcrumb>
<Breadcrumb.Item>首页</Breadcrumb.Item>
<Breadcrumb.Item>批量执行</Breadcrumb.Item>
Expand Down
6 changes: 6 additions & 0 deletions spug_web/src/pages/system/role/codes.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ export default [{
{key: 'edit', label: '编辑模板'},
{key: 'del', label: '删除模板'},
]
}, {
key: 'transfer',
label: '文件分发',
perms: [
{key: 'do', label: '文件分发'}
]
}]
}, {
key: 'deploy',
Expand Down
2 changes: 1 addition & 1 deletion spug_web/src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default [
icon: <CodeOutlined/>, title: '批量执行', auth: 'exec.task.do|exec.template.view', child: [
{title: '执行任务', auth: 'exec.task.do', path: '/exec/task', component: ExecTask},
{title: '模板管理', auth: 'exec.template.view', path: '/exec/template', component: ExecTemplate},
{title: '文件分发', auth: 'exec.transfer.view', path: '/exec/transfer', component: ExecTransfer},
{title: '文件分发', auth: 'exec.transfer.do', path: '/exec/transfer', component: ExecTransfer},
]
},
{
Expand Down

0 comments on commit 30c3712

Please sign in to comment.