use of com.iplanet.sso.SSOException in project OpenAM by OpenRock.
the class DelegationConfigNode method hasPermission.
boolean hasPermission(String realmName, String serviceName, String action, SSOToken ssoToken) throws DelegationException {
if (realmName == null) {
try {
realmName = DNMapper.orgNameToRealmName(ssoToken.getProperty(Constants.ORGANIZATION));
} catch (SSOException e) {
throw new DelegationException(e);
}
}
DelegationEvaluator delegationEvaluator = new DelegationEvaluatorImpl();
DelegationPermission delegationPermission = getDelegationPermission(realmName, action);
boolean allowed = false;
if (serviceName != null) {
allowed = isAllowed(delegationEvaluator, delegationPermission, ssoToken, serviceName);
} else {
Set actions = (Set) permissions.get(AMAdminConstants.PERMISSION_MODIFY);
for (Iterator i = actions.iterator(); i.hasNext() && !allowed; ) {
allowed = isAllowed(delegationEvaluator, delegationPermission, ssoToken, (String) i.next());
}
}
return allowed;
}
use of com.iplanet.sso.SSOException in project OpenAM by OpenRock.
the class AccessControlModelImpl method getServiceNames.
private Set getServiceNames() {
if (serviceNames == null) {
SSOToken adminSSOToken = (SSOToken) AccessController.doPrivileged(AdminTokenAction.getInstance());
try {
ServiceManager sm = new ServiceManager(adminSSOToken);
serviceNames = sm.getServiceNames();
} catch (SSOException e) {
AMModelBase.debug.error("AccessControlModelImpl.getServiceNames", e);
} catch (SMSException e) {
AMModelBase.debug.error("AccessControlModelImpl.getServiceNames", e);
}
}
return serviceNames;
}
use of com.iplanet.sso.SSOException in project OpenAM by OpenRock.
the class TabControllerBase method updateStatus.
protected void updateStatus() {
boolean status = false;
SSOToken adminSSOToken = (SSOToken) AccessController.doPrivileged(AdminTokenAction.getInstance());
try {
ServiceSchemaManager mgr = new ServiceSchemaManager(AMAdminConstants.ADMIN_CONSOLE_SERVICE, adminSSOToken);
ServiceSchema schema = mgr.getSchema(SchemaType.GLOBAL);
AttributeSchema as = schema.getAttributeSchema(getConfigAttribute());
Set defaultValue = as.getDefaultValues();
if ((defaultValue != null) && !defaultValue.isEmpty()) {
String val = (String) defaultValue.iterator().next();
status = (val != null) && val.equals("true");
}
} catch (SMSException e) {
AMModelBase.debug.error("TabControllerBase.updateStatus", e);
} catch (SSOException e) {
AMModelBase.debug.error("TabControllerBase.updateStatus", e);
}
visible = status;
}
use of com.iplanet.sso.SSOException in project OpenAM by OpenRock.
the class SubConfigMeta method deleteSubConfigurations.
/**
* Deletes sub configurations.
*
* @param names Set of sub configuration names that are to be deleted.
* @throws AMConsoleException if sub configurations cannot be deleted.
*/
public void deleteSubConfigurations(Set names) throws AMConsoleException {
String curName = null;
try {
if (parentConfig != null) {
String[] params = new String[3];
params[0] = serviceName;
params[1] = parentConfig.getComponentName();
for (Iterator iter = names.iterator(); iter.hasNext(); ) {
curName = (String) iter.next();
params[2] = curName;
amModel.logEvent("ATTEMPT_DELETE_GLOBAL_SUB_CONFIGURATION", params);
parentConfig.removeSubConfig(curName);
removeFromSubConfigList(curName);
amModel.logEvent("SUCCEED_DELETE_GLOBAL_SUB_CONFIGURATION", params);
}
}
} catch (SSOException e) {
String[] paramsEx = { serviceName, parentConfig.getComponentName(), curName, amModel.getErrorString(e) };
amModel.logEvent("SSO_EXCEPTION_DELETE_GLOBAL_SUB_CONFIGURATION", paramsEx);
throw new AMConsoleException(amModel.getErrorString(e));
} catch (SMSException e) {
String[] paramsEx = { serviceName, parentConfig.getComponentName(), curName, amModel.getErrorString(e) };
amModel.logEvent("SMS_EXCEPTION_DELETE_GLOBAL_SUB_CONFIGURATION", paramsEx);
throw new AMConsoleException(amModel.getErrorString(e));
}
}
use of com.iplanet.sso.SSOException in project OpenAM by OpenRock.
the class SubConfigMeta method setParentId.
public void setParentId(String parentId) {
if (validInstance()) {
resetMeta();
try {
getCorrespondingSchema(parentId);
getSupportedGlobalSubSchema();
if ((globalSubSchemaNames != null) && !globalSubSchemaNames.isEmpty()) {
creatableGlobalSubSchemas = new HashSet();
creatableGlobalSubSchemas.addAll(globalSubSchemaNames);
getSubConfigurationsFromConfig();
}
} catch (SSOException e) {
AMModelBase.debug.error("SubConfigMeta.getParentId", e);
} catch (SMSException e) {
AMModelBase.debug.error("SubConfigMeta.getParentId", e);
}
}
}
Aggregations