NIHVIVO-3523 The IsRootUser identifier takes no parameters, so make it a singleton.
This commit is contained in:
parent
5ca2848946
commit
f63722a2fe
1 changed files with 8 additions and 1 deletions
|
@ -9,10 +9,17 @@ import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle;
|
||||||
* The current user is a root user.
|
* The current user is a root user.
|
||||||
*/
|
*/
|
||||||
public class IsRootUser extends AbstractCommonIdentifier implements Identifier {
|
public class IsRootUser extends AbstractCommonIdentifier implements Identifier {
|
||||||
|
public static final IsRootUser INSTANCE = new IsRootUser();
|
||||||
|
|
||||||
public static boolean isRootUser(IdentifierBundle ids) {
|
public static boolean isRootUser(IdentifierBundle ids) {
|
||||||
return !getIdentifiersForClass(ids, IsRootUser.class).isEmpty();
|
return !getIdentifiersForClass(ids, IsRootUser.class).isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Enforce the singleton pattern. */
|
||||||
|
private IsRootUser() {
|
||||||
|
// Nothing to initialize.
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "IsRootUser";
|
return "IsRootUser";
|
||||||
|
|
Loading…
Add table
Reference in a new issue