This commit is contained in:
14
src/utils/business/auditAccess.ts
Normal file
14
src/utils/business/auditAccess.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { AuditInvestigationTarget } from '@/components/business/audit/types'
|
||||
|
||||
export const isPlatformAuditAccount = (userType?: number | null, isSuperAdmin = false) =>
|
||||
isSuperAdmin || [1, 2].includes(Number(userType))
|
||||
|
||||
export const canLoadAuditInvestigation = (
|
||||
target: AuditInvestigationTarget,
|
||||
userType?: number | null,
|
||||
isSuperAdmin = false
|
||||
) => {
|
||||
if (target.mode === 'agent') return Number(userType) === 3
|
||||
if (target.mode === 'enterprise') return Number(userType) === 4
|
||||
return isPlatformAuditAccount(userType, isSuperAdmin)
|
||||
}
|
||||
Reference in New Issue
Block a user