try
{
DefaultPersistentFactory dpf = getFactory();
Context c = null;
AuthorizationManager am = myAuthManager;
if (myBypassAuthManager != null)
{
am = myBypassAuthManager;
}
else
{
c = dpf.getKeelContext();
if (c == null)
{
throw new SecurityException(
"No context available and no bypass auth manager specified - unable to access secure persistent object "
+ getInstanceIdentifier());
}
}
if (am == null)
{
String msg = "Authmanager was not set for " + getName() + ", unable to verify authorization";
log.error(msg);
throw new SecurityException(msg);
}
return am.allowed(o, c);
}
catch (PersistenceException pe)
{
log.error("DB Error, unable to verify authorization", pe);
throw new SecurityException("DB error, unable to verify authorization");