NIHVIVO-3523 The IsRootUser identifier takes no parameters, so make it a singleton.

This commit is contained in:
j2blake 2011-12-23 16:49:19 +00:00
parent 5ca2848946
commit f63722a2fe

View file

@ -9,10 +9,17 @@ import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle;
* The current user is a root user.
*/
public class IsRootUser extends AbstractCommonIdentifier implements Identifier {
public static final IsRootUser INSTANCE = new IsRootUser();
public static boolean isRootUser(IdentifierBundle ids) {
return !getIdentifiersForClass(ids, IsRootUser.class).isEmpty();
}
/** Enforce the singleton pattern. */
private IsRootUser() {
// Nothing to initialize.
}
@Override
public String toString() {
return "IsRootUser";