mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: About permission
This commit is contained in:
parent
887de56877
commit
4648f08f98
|
|
@ -178,6 +178,7 @@ class Operate(Enum):
|
|||
AUTH = "READ+AUTH" # 资源授权
|
||||
TAG = "READ+TAG" # 标签设置
|
||||
REPLACE = "READ+REPLACE" # 标签设置
|
||||
UPDATE = "READ+UPDATE" # 更新license
|
||||
|
||||
|
||||
class RoleGroup(Enum):
|
||||
|
|
@ -1014,9 +1015,14 @@ class PermissionConstants(Enum):
|
|||
)
|
||||
|
||||
ABOUT_READ = Permission(group=Group.OTHER, operate=Operate.READ,
|
||||
role_list=[RoleConstants.ADMIN, RoleConstants.USER],
|
||||
parent_group=[SystemGroup.OTHER, WorkspaceGroup.OTHER, UserGroup.OTHER],
|
||||
label=_('About')
|
||||
)
|
||||
ABOUT_UPDATE = Permission(group=Group.OTHER, operate=Operate.UPDATE,
|
||||
role_list=[RoleConstants.ADMIN],
|
||||
parent_group=[SystemGroup.OTHER],
|
||||
label=_('About')
|
||||
label=_('Update License')
|
||||
)
|
||||
SWITCH_LANGUAGE = Permission(group=Group.OTHER, operate=Operate.EDIT,
|
||||
role_list=[RoleConstants.ADMIN, RoleConstants.USER],
|
||||
|
|
|
|||
|
|
@ -8742,4 +8742,7 @@ msgid "Download Original Document"
|
|||
msgstr ""
|
||||
|
||||
msgid "Replace Original Document"
|
||||
msgstr ""
|
||||
|
||||
msgid "Update License"
|
||||
msgstr ""
|
||||
|
|
@ -8869,3 +8869,6 @@ msgstr "下载原文档"
|
|||
|
||||
msgid "Replace Original Document"
|
||||
msgstr "替换原文档"
|
||||
|
||||
msgid "Update License"
|
||||
msgstr "更新许可证"
|
||||
|
|
@ -8869,3 +8869,6 @@ msgstr "下載原文件"
|
|||
|
||||
msgid "Replace Original Document"
|
||||
msgstr "替換原文件"
|
||||
|
||||
msgid "Update License"
|
||||
msgstr "更新許可證"
|
||||
|
|
|
|||
|
|
@ -49,7 +49,10 @@
|
|||
:auto-upload="false"
|
||||
:show-file-list="false"
|
||||
:on-change="onChange"
|
||||
v-hasPermission="new Role('ADMIN')"
|
||||
v-if="hasPermission([
|
||||
RoleConst.ADMIN,
|
||||
PermissionConst.ABOUT_UPDATE
|
||||
],'OR')"
|
||||
>
|
||||
<el-button class="border-primary mr-16"
|
||||
>{{ $t('layout.about.update') }} License
|
||||
|
|
@ -70,6 +73,8 @@ import {fromNowDate} from '@/utils/time'
|
|||
import {Role} from '@/utils/permission/type'
|
||||
import useStore from '@/stores'
|
||||
import { t } from '@/locales'
|
||||
import { hasPermission } from '@/utils/permission'
|
||||
import { PermissionConst, RoleConst } from '@/utils/permission/data'
|
||||
const {user, theme} = useStore()
|
||||
const isDefaultTheme = computed(() => {
|
||||
return theme.isDefaultTheme()
|
||||
|
|
|
|||
|
|
@ -320,6 +320,7 @@ const PermissionConst = {
|
|||
OPERATION_LOG_CLEAR_POLICY: new Permission('OPERATION_LOG:READ+CLEAR_POLICY'),
|
||||
|
||||
ABOUT_READ: new Permission('OTHER:READ'),
|
||||
ABOUT_UPDATE: new Permission('OTHER:READ+UPDATE'),
|
||||
SWITCH_LANGUAGE: new Permission('OTHER:READ+EDIT'),
|
||||
CHANGE_PASSWORD: new Permission('OTHER:READ+CREATE'),
|
||||
SYSTEM_API_KEY_EDIT: new Permission('OTHER:READ+DELETE'),
|
||||
|
|
|
|||
Loading…
Reference in New Issue