fix: improve role classification logic and future scalability
This commit is contained in:
+2
-2
@@ -1,9 +1,9 @@
|
||||
const standartRoles = ['emp|doc', 'emp|nur', 'emp|reg', 'emp|pha', 'emp|pay', 'emp|mng']
|
||||
export const medicalPositions = ['emp|doc', 'emp|nur', 'emp|nut', 'emp|mid', 'emp|lab', 'emp|reg', 'emp|pha', 'emp|pay', 'emp|mng']
|
||||
const verificatorRole = 'verificator'
|
||||
|
||||
export function getPositionAs(roleAccess: string): string {
|
||||
if (roleAccess.includes('|')) {
|
||||
if (standartRoles.includes(roleAccess)) {
|
||||
if (medicalPositions.includes(roleAccess)) {
|
||||
return 'medical'
|
||||
}
|
||||
if (roleAccess.includes(verificatorRole)) {
|
||||
|
||||
Reference in New Issue
Block a user