public synchronized void addScopedRole(ScopedRole toAdd) { for (ScopedRoleListener listener : scopedRoleListeners) { listener.scopedRoleAdded(toAdd); } Map<String, ScopedRole> newScopedRoles = new HashMap<String, ScopedRole>(roleMaps.scopedRoles); newScopedRoles.put(toAdd.getName(), toAdd); roleMaps = new RoleMaps(roleMaps.standardRoles, newScopedRoles); }
static void addScopedRole(final String roleName, final String baseRole, final List<ModelNode> serverGroupNodes, final WritableAuthorizerConfiguration authorizerConfiguration, final Map<String, ServerGroupEffectConstraint> constraintMap) { List<String> serverGroups = new ArrayList<String>(); for (ModelNode group : serverGroupNodes) { serverGroups.add(group.asString()); } ServerGroupEffectConstraint constraint = new ServerGroupEffectConstraint(serverGroups); authorizerConfiguration.addScopedRole(new AuthorizerConfiguration.ScopedRole(roleName, baseRole, constraint)); constraintMap.put(roleName, constraint); } }
@Override public synchronized void scopedRoleRemoved(AuthorizerConfiguration.ScopedRole removed) { String officialForm = getOfficialForm(removed.getName()); StandardRole standard; try { standard = StandardRole.valueOf(officialForm); } catch (RuntimeException ignored) { // wasn't a standard role standard = null; } if (standard != null) { throw ControllerLogger.ROOT_LOGGER.cannotRemoveStandardRole(standard.toString()); } synchronized (this) { scopedBaseMap.remove(officialForm); rolePermissionsConfigured = false; } }
@Override public synchronized void scopedRoleRemoved(AuthorizerConfiguration.ScopedRole removed) { String officialForm = getOfficialForm(removed.getName()); StandardRole standard; try { standard = StandardRole.valueOf(officialForm); } catch (RuntimeException ignored) { // wasn't a standard role standard = null; } if (standard != null) { throw ControllerMessages.MESSAGES.cannotRemoveStandardRole(standard.toString()); } synchronized (this) { scopedBaseMap.remove(officialForm); rolePermissionsConfigured = false; } }
@Override public synchronized void scopedRoleRemoved(AuthorizerConfiguration.ScopedRole removed) { String officialForm = getOfficialForm(removed.getName()); StandardRole standard; try { standard = StandardRole.valueOf(officialForm); } catch (RuntimeException ignored) { // wasn't a standard role standard = null; } if (standard != null) { throw ControllerLogger.ROOT_LOGGER.cannotRemoveStandardRole(standard.toString()); } synchronized (this) { scopedBaseMap.remove(officialForm); rolePermissionsConfigured = false; } }
@Override public synchronized void scopedRoleAdded(AuthorizerConfiguration.ScopedRole added) { String roleName = added.getName(); String officialForm = getOfficialForm(roleName); if (permissionsByRole.containsKey(officialForm)) { throw ControllerMessages.MESSAGES.roleIsAlreadyRegistered(roleName); } String baseName = added.getBaseRoleName(); String officialBase = getOfficialForm(baseName); if (rolePermissionsConfigured && !permissionsByRole.containsKey(officialBase)) { throw ControllerMessages.MESSAGES.unknownBaseRole(baseName); } ScopingConstraint constraint = added.getScopingConstraint(); addConstraintFactory(constraint.getFactory()); scopedBaseMap.put(officialForm, new ScopedBase(StandardRole.valueOf(officialBase), constraint)); rolePermissionsConfigured = false; }
@Override public synchronized void scopedRoleAdded(AuthorizerConfiguration.ScopedRole added) { String roleName = added.getName(); String officialForm = getOfficialForm(roleName); if (permissionsByRole.containsKey(officialForm)) { throw ControllerLogger.ROOT_LOGGER.roleIsAlreadyRegistered(roleName); } String baseName = added.getBaseRoleName(); String officialBase = getOfficialForm(baseName); if (rolePermissionsConfigured && !permissionsByRole.containsKey(officialBase)) { throw ControllerLogger.ROOT_LOGGER.unknownBaseRole(baseName); } ScopingConstraint constraint = added.getScopingConstraint(); addConstraintFactory(constraint.getFactory()); scopedBaseMap.put(officialForm, new ScopedBase(StandardRole.valueOf(officialBase), constraint)); rolePermissionsConfigured = false; }
@Override public synchronized void scopedRoleAdded(AuthorizerConfiguration.ScopedRole added) { String roleName = added.getName(); String officialForm = getOfficialForm(roleName); if (permissionsByRole.containsKey(officialForm)) { throw ControllerLogger.ROOT_LOGGER.roleIsAlreadyRegistered(roleName); } String baseName = added.getBaseRoleName(); String officialBase = getOfficialForm(baseName); if (rolePermissionsConfigured && !permissionsByRole.containsKey(officialBase)) { throw ControllerLogger.ROOT_LOGGER.unknownBaseRole(baseName); } ScopingConstraint constraint = added.getScopingConstraint(); addConstraintFactory(constraint.getFactory()); scopedBaseMap.put(officialForm, new ScopedBase(StandardRole.valueOf(officialBase), constraint)); rolePermissionsConfigured = false; }
static void addScopedRole(final String roleName, final String baseRole, final List<ModelNode> hostNodes, final WritableAuthorizerConfiguration authorizerConfiguration, final Map<String, HostEffectConstraint> constraintMap) { List<String> hosts = new ArrayList<String>(); for (ModelNode host : hostNodes) { hosts.add(host.asString()); } HostEffectConstraint constraint = new HostEffectConstraint(hosts); authorizerConfiguration.addScopedRole(new AuthorizerConfiguration.ScopedRole(roleName, baseRole, constraint)); constraintMap.put(roleName, constraint); } }
static void addScopedRole(final String roleName, final String baseRole, final List<ModelNode> hostNodes, final WritableAuthorizerConfiguration authorizerConfiguration, final Map<String, HostEffectConstraint> constraintMap) { List<String> hosts = new ArrayList<String>(); for (ModelNode host : hostNodes) { hosts.add(host.asString()); } HostEffectConstraint constraint = new HostEffectConstraint(hosts); authorizerConfiguration.addScopedRole(new AuthorizerConfiguration.ScopedRole(roleName, baseRole, constraint)); constraintMap.put(roleName, constraint); } }
static void addScopedRole(final String roleName, final String baseRole, final List<ModelNode> serverGroupNodes, final WritableAuthorizerConfiguration authorizerConfiguration, final Map<String, ServerGroupEffectConstraint> constraintMap) { List<String> serverGroups = new ArrayList<String>(); for (ModelNode group : serverGroupNodes) { serverGroups.add(group.asString()); } ServerGroupEffectConstraint constraint = new ServerGroupEffectConstraint(serverGroups); authorizerConfiguration.addScopedRole(new AuthorizerConfiguration.ScopedRole(roleName, baseRole, constraint)); constraintMap.put(roleName, constraint); } }
public synchronized void addScopedRole(ScopedRole toAdd) { for (ScopedRoleListener listener : scopedRoleListeners) { listener.scopedRoleAdded(toAdd); } Map<String, ScopedRole> newScopedRoles = new HashMap<String, ScopedRole>(roleMaps.scopedRoles); newScopedRoles.put(toAdd.getName(), toAdd); roleMaps = new RoleMaps(roleMaps.standardRoles, newScopedRoles); }
public synchronized void addScopedRole(ScopedRole toAdd) { for (ScopedRoleListener listener : scopedRoleListeners) { listener.scopedRoleAdded(toAdd); } Map<String, ScopedRole> newScopedRoles = new HashMap<String, ScopedRole>(roleMaps.scopedRoles); newScopedRoles.put(toAdd.getName(), toAdd); roleMaps = new RoleMaps(roleMaps.standardRoles, newScopedRoles); }