本文整理了Java中org.jboss.errai.security.shared.api.Group
类的一些代码示例,展示了Group
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Group
类的具体详情如下:
包路径:org.jboss.errai.security.shared.api.Group
类名称:Group
[英]Represents a group a User can be part of for the purpose of access control.
The default implementation of this group in Errai is GroupImpl, but a different implementation may be used so long as:
代码示例来源:origin: errai/errai
public boolean hasAnyGroups(String... groupNames) {
for (Group group : groups) {
for (String groupName : groupNames) {
if (groupName.equals(group.getName())) {
return true;
}
}
}
return false;
}
代码示例来源:origin: kiegroup/appformer
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);
}
}
代码示例来源:origin: kiegroup/appformer
public void write(Group group,
int priority,
Map out) {
String key = GROUP + "." + group.getName() + "." + PRIORITY;
out.put(key,
Integer.toString(priority));
}
代码示例来源:origin: org.uberfire/uberfire-security-management-wildfly-commons
/**
* 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() );
}
代码示例来源:origin: kiegroup/appformer
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;
}
代码示例来源:origin: org.uberfire/uberfire-widgets-security-management
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;
}
代码示例来源:origin: org.uberfire/uberfire-widgets-security-management
@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);
}
代码示例来源:origin: kiegroup/appformer
@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);
}
代码示例来源:origin: kiegroup/appformer
@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());
代码示例来源:origin: kiegroup/appformer
@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);
}
代码示例来源:origin: kiegroup/appformer
@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());
代码示例来源:origin: kiegroup/appformer
@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());
代码示例来源:origin: kiegroup/appformer
@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);
}
代码示例来源:origin: org.uberfire/uberfire-security-management-backend
@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());
代码示例来源:origin: org.uberfire/uberfire-security-management-backend
@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());
代码示例来源:origin: kiegroup/appformer
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;
}
}
代码示例来源:origin: org.uberfire/uberfire-backend-server
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;
}
}
代码示例来源:origin: org.uberfire/uberfire-security-management-backend
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;
}
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-workbench-client
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;
}
代码示例来源:origin: org.uberfire/uberfire-security-management-keycloak
private void assertGroup(Group group,
String name) {
assertNotNull(group);
assertEquals(name,
group.getName());
}
内容来源于网络,如有侵权,请联系作者删除!