Skip to content

Branch Admin Requires Code Change #3

@slominskir

Description

@slominskir

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:

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions