本文整理了Java中org.jboss.errai.security.shared.api.Group.getName()
方法的一些代码示例,展示了Group.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Group.getName()
方法的具体详情如下:
包路径:org.jboss.errai.security.shared.api.Group
类名称:Group
方法名:getName
暂无
代码示例来源: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
@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 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: 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-keycloak
private void assertGroup(Group group,
String name) {
assertNotNull(group);
assertEquals(name,
group.getName());
}
代码示例来源:origin: kiegroup/appformer
public void write(Group group,
PermissionCollection permissions,
Map out) {
for (Permission p : permissions.collection()) {
boolean granted = p.getResult() != null && p.getResult().equals(AuthorizationResult.ACCESS_GRANTED);
String key = GROUP + "." + group.getName() + "." + PERMISSION + "." + p.getName();
out.put(key,
Boolean.toString(granted));
}
}
代码示例来源:origin: org.uberfire/uberfire-security-management-wildfly
@Test(expected = UnsupportedServiceCapabilityException.class)
public void testUpdateGroup() {
Group group = mock(Group.class);
when(group.getName()).thenReturn("role10");
groupsPropertiesManager.update(group);
}
代码示例来源:origin: org.uberfire/uberfire-security-management-tomcat
@Test
public void testCreateGroup() {
Group group = mock(Group.class);
when(group.getName()).thenReturn("role10");
groupsManager.create(group);
Group created = groupsManager.get("role10");
assertNotNull(created);
assertEquals("role10",
created.getName());
}
代码示例来源:origin: kiegroup/appformer
@Test
public void testValid() {
final Group group = mock(Group.class);
when(group.getName()).thenReturn("group1");
Set<ConstraintViolation<Group>> violations = new GroupValidatorTestImpl().validate(group);
assertTrue(violations.isEmpty());
}
代码示例来源:origin: kiegroup/appformer
@Test
public void testBlankGroupName() {
final Group blankGroup = mock(Group.class);
when(blankGroup.getName()).thenReturn("");
final Set<ConstraintViolation<Group>> violations1 = new GroupValidatorTestImpl().validate(blankGroup);
assertTrue(violations1.size() == 1);
final ConstraintViolation<Group> violation = violations1.iterator().next();
assertEquals(violation.getPropertyPath().iterator().next().getName(),
"name");
assertEquals(violation.getMessage(),
GroupValidator.KEY_NAME_NOT_EMPTY);
}
代码示例来源:origin: org.uberfire/uberfire-widgets-security-management
protected void setDirty(final boolean isDirty) {
this.isDirty = isDirty;
view.setSaveButtonVisible(isDirty);
view.setSaveButtonEnabled(isDirty);
view.setCancelButtonVisible(true);
if (isDirty) {
view.showNotification(UsersManagementWidgetsConstants.INSTANCE.groupModified(group.getName()));
} else {
view.clearNotifications();
}
}
代码示例来源:origin: org.uberfire/uberfire-security-management-wildfly
private void assertGet(String name) {
Group group = groupsPropertiesManager.get(name);
assertNotNull(group);
assertEquals(group.getName(),
name);
}
代码示例来源:origin: kiegroup/appformer
@Test
public void testCreateGroup() {
final String testId = "id1";
final Group group = SecurityManagementUtils.createGroup(testId);
assertNotNull(group);
final String name = group.getName();
assertEquals(name,
testId);
}
内容来源于网络,如有侵权,请联系作者删除!