新增财务角色与财务报表并完善后台权限
This commit is contained in:
@@ -2,6 +2,10 @@ import { query, withTransaction } from '../../db/client.js'
|
||||
import { createHttpError } from '../../utils/http.js'
|
||||
|
||||
export const ADMIN_PERMISSION_KEYS = [
|
||||
'finance.view',
|
||||
'finance.review',
|
||||
'finance.config',
|
||||
'finance.export',
|
||||
'worker_order.view',
|
||||
'worker_order.edit',
|
||||
'worker_order.configure_share',
|
||||
@@ -112,7 +116,7 @@ export async function updateAdminRolePermissions(roleKey: unknown, permissionKey
|
||||
const normalizedRole = String(roleKey || '')
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
if (!['admin', 'operator', 'support'].includes(normalizedRole)) {
|
||||
if (!['admin', 'operator', 'support', 'finance'].includes(normalizedRole)) {
|
||||
throw createHttpError('角色不存在或不可修改', {
|
||||
statusCode: 400,
|
||||
errorCode: 'admin_role_invalid',
|
||||
|
||||
Reference in New Issue
Block a user