public boolean hasAnyGroups(String... groupNames) { for (Group group : groups) { for (String groupName : groupNames) { if (groupName.equals(group.getName())) { return true; } } } return false; }
public void write(Group group, String homePerspectiveId, Map out) { String key = GROUP + "." + group.getName() + "." + HOME; out.remove(key); if (homePerspectiveId != null) { out.put(key, homePerspectiveId); } }
public void write(Group group, int priority, Map out) { String key = GROUP + "." + group.getName() + "." + PRIORITY; out.put(key, Integer.toString(priority)); }
/** * 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() ); }
protected Set<String> getGroupNames() { final Set<String> result = new LinkedHashSet<String>(user.getGroups().size()); for (final Group group : user.getGroups()) { result.add(group.getName()); } return result; }
protected Set<String> getGroupNames() { final Set<String> result = new LinkedHashSet<String>(user.getGroups().size()); for (final Group group : user.getGroups()) { result.add(group.getName()); } return result; }
@Override protected void open(final User user) { final Set<Group> userGroups = user.getGroups(); for (final Group group : userGroups) { if (!userSystemManager.getConstrainedGroups().contains(group.getName())) { this.entities.add(group); } } super.open(user); }
@Override protected void open(final User user) { final Set<Group> userGroups = user.getGroups(); for (final Group group : userGroups) { if (!userSystemManager.getConstrainedGroups().contains(group.getName())) { this.entities.add(group); } } super.open(user); }
@Override public Group answer(InvocationOnMock invocationOnMock) throws Throwable { String name = (String) invocationOnMock.getArguments()[0]; Group g = mock(Group.class); when(g.getName()).thenReturn(name); return g; } }).when(groupManager).get(anyString());
@Override public Group create(Group group) throws SecurityManagementException { final String name = group.getName(); if (isConstrained(name)) { throw new IllegalArgumentException("Group with name '" + name + "' cannot be created, " + "as it is a constrained value (it is a role or the admin group"); } final GroupManager serviceImpl = getService(); return serviceImpl.create(group); }
@Override public Group answer(InvocationOnMock invocationOnMock) throws Throwable { final String _name = (String) invocationOnMock.getArguments()[0]; final Group group = mock(Group.class); when(group.getName()).thenReturn(_name); return group; } }).when(userSystemManager).createGroup(anyString());
@Override public Group answer(InvocationOnMock invocationOnMock) throws Throwable { String name = (String) invocationOnMock.getArguments()[0]; Group g = mock(Group.class); when(g.getName()).thenReturn(name); return g; } }).when(groupManager).get(anyString());
@Override public Group update(Group group) throws SecurityManagementException { final String name = group.getName(); if (isConstrained(name)) { throw new IllegalArgumentException("Group with name '" + name + "' cannot be updated, " + "as it is a constrained value (it is a role or the admin group"); } final GroupManager serviceImpl = getService(); return serviceImpl.update(group); }
@Override public Group answer(InvocationOnMock invocationOnMock) throws Throwable { String name = (String) invocationOnMock.getArguments()[0]; Group g = mock(Group.class); when(g.getName()).thenReturn(name); return g; } }).when(groupManager).get(anyString());
@Override public Group answer(InvocationOnMock invocationOnMock) throws Throwable { String name = (String) invocationOnMock.getArguments()[0]; Group g = mock(Group.class); when(g.getName()).thenReturn(name); return g; } }).when(groupManager).get(anyString());
private List<Group> createTestGroups(String namePrefix, int size) { List<Group> groups = new LinkedList<Group>(); for (int x = 0; x < size; x++) { Group group = mock(Group.class); when(group.getName()).thenReturn(namePrefix + x); groups.add(group); } return groups; } }
private List<org.jboss.errai.security.shared.api.Group> mockGroups( String... names ) { ArrayList<org.jboss.errai.security.shared.api.Group> groups = new ArrayList<org.jboss.errai.security.shared.api.Group>(); for ( String name : names ) { org.jboss.errai.security.shared.api.Group g = mock( org.jboss.errai.security.shared.api.Group.class ); when( g.getName() ).thenReturn( name ); groups.add( g ); } return groups; } }
private List<Group> createTestGroups(String namePrefix, int size) { List<Group> groups = new LinkedList<Group>(); for (int x = 0; x < size; x++) { Group group = mock(Group.class); when(group.getName()).thenReturn(namePrefix + x); groups.add(group); } return groups; } }
public List<Menus> getGroups() { final Set<Group> groups = identity.getGroups(); final List<Menus> result = new ArrayList<Menus>(groups.size()); for (final Group group : groups) { result.add(MenuFactory.newSimpleItem(constants.Group() + ": " + group.getName()).endMenu().build()); } return result; }
private void assertGroup(Group group, String name) { assertNotNull(group); assertEquals(name, group.getName()); }