public static Group createGroup(final String name) { if (name == null) { return null; } return new GroupImpl(name); }
public Group createGroup(final String name) { if (name == null) { return null; } return new GroupImpl(name); }
public Group createGroup(final String name) { if (name == null) { return null; } return new GroupImpl(name); }
private Group getGroup(String groupName) { Group group = groupMap.get(groupName); if (group == null) { group = new GroupImpl(groupName); groupMap.put(groupName, group); } return group; }
private Group getGroup(String groupName) { Group group = groupMap.get(groupName); if (group == null) { group = new GroupImpl(groupName); groupMap.put(groupName, group); } return group; }
public AuthorizationPolicyBuilder group(String group) { _currentRole = null; _currentGroup = groups.get(group); if (_currentGroup == null) { groups.put(group, _currentGroup = new GroupImpl(group)); } return this; }
public AuthorizationPolicyBuilder group(String group) { _currentRole = null; _currentGroup = groups.get(group); if (_currentGroup == null) { groups.put(group, _currentGroup = new GroupImpl(group)); } return this; }
/** * Wildfly / EAP realms based on properties do not allow groups with empty users. So the groups are created using the method #assignUsers. * @param entity The entity to create. * @return A runtime instance for a group. * @throws SecurityManagementException */ @Override public Group create(Group entity) throws SecurityManagementException { if (entity == null) { throw new NullPointerException(); } return new GroupImpl(entity.getName()); }
/** * WildFly / EAP realms based on properties do not allow groups with empty users. So the groups are created using the method #assignUsers. * * @param entity The entity to create. * @return A runtime instance for a group. * @throws SecurityManagementException */ @Override public Group create( Group entity ) throws SecurityManagementException { if (entity == null) throw new NullPointerException(); return new GroupImpl( entity.getName() ); }
/** * Wildfly / EAP realms based on properties do not allow groups with empty users. So the groups are created using the method #assignUsers. * @param entity The entity to create. * @return A runtime instance for a group. * @throws SecurityManagementException */ @Override public Group create(Group entity) throws SecurityManagementException { if (entity == null) { throw new NullPointerException(); } return new GroupImpl(entity.getName()); }
@Override public List<Group> getGroups(final String principal, final Object subject) { if (registry == null) { return Collections.emptyList(); } final List<Group> groups = new ArrayList<Group>(); try { Method method = registry.getClass().getMethod("getGroupsForUser", new Class[]{String.class}); List rolesIn = (List) method.invoke(registry, new Object[]{principal}); if (rolesIn != null) { for (Object o : rolesIn) { groups.add(new GroupImpl(o.toString())); } } } catch (Exception e) { logger.error("Unable to get groups from registry due to {}", e.getMessage(), e); } return groups; } }
for (java.security.Principal p : wlsSubject.getPrincipals()) { if (p.getClass().getName().indexOf("WLSGroup") != -1) { groups.add(new GroupImpl(p.getName()));
public JettyGroupsAdapter() { InputStream input = this.getClass().getResourceAsStream(GROUPS_DEFINITION_FILE); if (input != null) { try { Properties properties = new Properties(); properties.load(input); groupsByUser = new HashMap<String, List<Group>>(); Set<String> userNames = properties.stringPropertyNames(); for (String userName : userNames) { String groupsStr = properties.getProperty(userName); List<Group> userGroups = new ArrayList<Group>(); if (groupsStr != null) { String[] groups = groupsStr.split(","); for (String group : groups) { userGroups.add(new GroupImpl(group)); } } groupsByUser.put(userName, userGroups); } } catch (IOException e) { logger.warn("Unable to load jetty-groups.properties file due to {}", e.getMessage()); } } }
/** * For a given collection of principal names, return the Role instances for the ones * that are considered roles, so the ones that exist on the RoleRegistry. */ protected List<Group> getGroups(List<String> principals) { if (null != principals && !principals.isEmpty()) { Set<Role> registeredRoles = RoleRegistry.get().getRegisteredRoles(); if (null != registeredRoles && !registeredRoles.isEmpty()) { List<Group> result = new LinkedList<Group>(); for (String role : principals) { if (null == RoleRegistry.get().getRegisteredRole(role)) { result.add(new GroupImpl(role)); } } return result; } } return Collections.emptyList(); }
public boolean flush() { assert this.isEditMode; this.isFlushed = true; groupEditor.flush(); // Obtain the editor's values final String name = groupEditor.name(); // Create a new resulting instance group = new GroupImpl(name); // Validate the instance and set delegate violations, if any, to the editors hierarchy. Set<ConstraintViolation<Group>> violations = userSystemManager.groupsValidator().validate(group); groupEditor.setViolations(violations); return violations == null || violations.isEmpty(); }
public boolean flush() { assert this.isEditMode; this.isFlushed = true; groupEditor.flush(); // Obtain the editor's values final String name = groupEditor.name(); // Create a new resulting instance group = new GroupImpl(name); // Validate the instance and set delegate violations, if any, to the editors hierarchy. Set<ConstraintViolation<Group>> violations = userSystemManager.groupsValidator().validate(group); groupEditor.setViolations(violations); return violations == null || violations.isEmpty(); }
private void assertGroupsForUser(Set<Group> groupsSet, String[] groups) { assertNotNull(groupsSet); assertEquals(groupsSet.size(), groups.length); int x = 0; for (Group g : groupsSet) { String gName = groups[x]; assertTrue(groupsSet.contains(new GroupImpl(gName))); x++; } }
private void assertGroupsForUser(Set<Group> groupsSet, String[] groups) { assertNotNull(groupsSet); assertEquals(groupsSet.size(), groups.length); int x = 0; for (Group g : groupsSet) { String gName = groups[x]; assertTrue(groupsSet.contains(new GroupImpl(gName))); x++; } } }
private void assertGroupsForUser(Set<Group> groupsSet, String[] groups) { assertNotNull(groupsSet); assertEquals(groupsSet.size(), groups.length); int x = 0; for (Group g : groupsSet) { String gName = groups[x]; assertTrue(groupsSet.contains(new GroupImpl(gName))); x++; } } }
@Test public void testEditGroup() { presenter.edit(new GroupImpl("group1")); verify(view).setHomePerspectiveSelectorEnabled(true); verify(view).setPrioritySelectorEnabled(true); verify(view).setHomePerspectiveSelector(any()); verify(view).setPrioritySelector(any()); verify(homePerspectiveDropDown).setSelectedPerspective("HomeGroup1"); verify(priorityDropDown).setSelectedPriority(DEFAULT_PRIORITY); }