private static String getExternalRealmId(String siteId) { String realmId = SiteService.siteReference(siteId); String rv = null; try { AuthzGroup realm = ComponentManager.get(AuthzGroupService.class).getAuthzGroup(realmId); rv = realm.getProviderGroupId(); } catch (GroupNotDefinedException e) { log.error("SiteParticipantHelper.getExternalRealmId: site realm not found {}", e.getMessage()); } return rv; } // getExternalRealmId
protected Agent getRole(String username) throws IdUnusedException { String roleName; String siteId; int pos = username.lastIndexOf('/'); siteId = username.substring(0, pos); roleName = username.substring(pos + 1); Role role = null; AuthzGroup realm = null; try { realm = AuthzGroupService.getAuthzGroup(siteId); } catch (GroupNotDefinedException e) { throw new IdUnusedException (e.getId()); } if (realm != null) role = realm.getRole(roleName); if (role == null || realm == null) { return null; } return convertRole(role, realm); }
public List<String> getRoleIdsInRealm(String realmId) { AuthzGroup group; try { group = authzGroupService.getAuthzGroup(realmId); List<String> ret = new ArrayList<String>(); Set<Role> roles = group.getRoles(); Iterator<Role> i = roles.iterator(); while (i.hasNext()) { Role role = (Role)i.next(); ret.add(role.getId()); } return ret; } catch (GroupNotDefinedException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; }
/** * {@inheritDoc} */ public AuthzGroup getAuthzGroup(String id) throws GroupNotDefinedException { // Note: since this is a "read" operations, we do NOT refresh (i.e. write) the provider info. if (id == null) throw new GroupNotDefinedException("<null>"); AuthzGroup azGroup = m_storage.get(id); // if not found if (azGroup == null) { throw new GroupNotDefinedException(id); } return azGroup; }
if (azGroup == null) throw new GroupNotDefinedException(authzGroupId); if (role == null) throw new GroupNotDefinedException(roleId);
private static String getExternalRealmId(String siteId) { String realmId = SiteService.siteReference(siteId); String rv = null; try { AuthzGroup realm = ComponentManager.get(AuthzGroupService.class).getAuthzGroup(realmId); rv = realm.getProviderGroupId(); } catch (GroupNotDefinedException e) { log.error("SiteParticipantHelper.getExternalRealmId: site realm not found {}", e.getMessage()); } return rv; } // getExternalRealmId
public boolean isRoleAllowedInRealm(String roleId, String realmId, String permission) { try { AuthzGroup group = authzGroupService.getAuthzGroup(realmId); Role role = group.getRole(roleId); return role.isAllowed(permission); } catch (GroupNotDefinedException e) { // TODO Auto-generated catch block e.printStackTrace(); } return false; }
/** * @inheritDoc */ public void unjoin(String id) throws IdUnusedException, PermissionException { try { authzGroupService().unjoinGroup(siteReference(id)); } catch (GroupNotDefinedException e) { throw new IdUnusedException(e.getId()); } catch (AuthzPermissionException e) { throw new PermissionException(e.getUser(), e.getFunction(), e.getResource()); } }
if (azGroup.getId() == null) throw new GroupNotDefinedException("<null>"); throw new GroupNotDefinedException(azGroup.getId());
M_log.warn(e.getMessage(), e);
} catch (GroupNotDefinedException e) { e.printStackTrace(); } catch (AuthzPermissionException e) {
throw new IdUnusedException(e.getId());
if (azGroup == null) throw new GroupNotDefinedException(authzGroupId);
M_log.warn(":getSelectedGroupUsers " + gException.getMessage() + " authGroupId=" + authzGroupRef);
log.error("SiteParticipantHelper.getExternalRealmId: site realm not found {}", e.getMessage());
log.error("SiteParticipantHelper.getExternalRealmId: site realm not found {}", e.getMessage());
M_log.warn(" removeSubmission: cannot find group for submission " + submission.getReference() + " : " + e.getMessage());
log.error(e.getMessage(), e); } catch (IdUnusedException e) { log.error(e.getMessage(), e);