Methods Summary |
---|
public static boolean | checkSecurityToken(java.lang.Object name, java.lang.Object token)Check a submitted security token. The submitted token must be equal to
the token present in the repository. If no token is present for the
context, then returns true.
Object refToken = securityTokens.get(name);
if (refToken == null)
return (true);
if ((refToken != null) && (refToken.equals(token)))
return (true);
return (false);
|
public static boolean | isWritable(java.lang.Object name)Returns if a context is writable.
return !(readOnlyContexts.containsKey(name));
|
public static void | setReadOnly(java.lang.Object name)Set whether or not a context is writable.
readOnlyContexts.put(name, name);
|
public static void | setSecurityToken(java.lang.Object name, java.lang.Object token)Set a security token for a context. Can be set only once.
// --------------------------------------------------------- Public Methods
if ((!securityTokens.containsKey(name)) && (token != null)) {
securityTokens.put(name, token);
}
|
public static void | setWritable(java.lang.Object name, java.lang.Object token)Allow writing to a context.
if (checkSecurityToken(name, token))
readOnlyContexts.remove(name);
|
public static void | unsetSecurityToken(java.lang.Object name, java.lang.Object token)Remove a security token for a context.
if (checkSecurityToken(name, token)) {
securityTokens.remove(name);
}
|