-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Ideally assignment of a new branch admin role could be done completely without having to change the code. A new table could be created for this purpose, for example. See:
srm/src/main/java/org/jlab/srm/business/session/AbstractFacade.java
Lines 216 to 252 in 25852c3
protected boolean isAdminOrBranchAdmin(String username, Category branchRoot) { | |
boolean isAdminOrBranchAdmin = false; | |
boolean isAdmin = context.isCallerInRole("srm-admin"); | |
if (isAdmin) { | |
isAdminOrBranchAdmin = true; | |
} else { | |
boolean isBranchAdmin = false; | |
if (branchRoot != null) { | |
switch (branchRoot.getName()) { | |
case "Hall A": | |
isBranchAdmin = context.isCallerInRole("halead"); | |
break; | |
case "Hall B": | |
isBranchAdmin = context.isCallerInRole("hblead"); | |
break; | |
case "Hall C": | |
isBranchAdmin = context.isCallerInRole("hclead"); | |
break; | |
case "Hall D": | |
isBranchAdmin = context.isCallerInRole("hdlead"); | |
break; | |
case "LERF": | |
isBranchAdmin = context.isCallerInRole("lerfadm"); | |
break; | |
case "Cryo": | |
isBranchAdmin = context.isCallerInRole("cryoadm"); | |
break; | |
} | |
} | |
if (isBranchAdmin) { | |
isAdminOrBranchAdmin = true; | |
} | |
} | |
return isAdminOrBranchAdmin; | |
} |
Issue moved from Jira
Metadata
Metadata
Assignees
Labels
No labels