public GeoServerUserGroup copy() { return new GeoServerUserGroup(this); }
public GeoServerUserGroup createGroupObject(String groupname, boolean isEnabled) throws IOException { GeoServerUserGroup group = new GeoServerUserGroup(groupname); group.setEnabled(isEnabled); return group; }
protected void addGroups(GeoServerUserGroupStore ugStore, String... groupNames) throws IOException { for (String groupName : groupNames) { GeoServerUserGroup grp = new GeoServerUserGroup(groupName); expect(ugStore.getGroupByGroupname(groupName)).andReturn(grp).anyTimes(); } }
/** * @see org.geoserver.security.GeoServerUserGroupService#createGroupObject(java.lang.String, boolean) */ public GeoServerUserGroup createGroupObject(String groupname, boolean isEnabled) throws IOException{ GeoServerUserGroup group = new GeoServerUserGroup(groupname); group.setEnabled(isEnabled); return group; }
public NewGroupPage(String userGroupServiceName) { super(userGroupServiceName, new GeoServerUserGroup("")); if (!hasUserGroupStore(userGroupServiceName)) { throw new IllegalStateException("New group not possible for read only service"); } }
public NewGroupPage(String userGroupServiceName) { super(userGroupServiceName,new GeoServerUserGroup("")); if (!hasUserGroupStore(userGroupServiceName)) { throw new IllegalStateException("New group not possible for read only service"); } }
public NewGroupPage(String userGroupServiceName) { super(userGroupServiceName,new GeoServerUserGroup("")); if (!hasUserGroupStore(userGroupServiceName)) { throw new IllegalStateException("New group not possible for read only service"); } }
@Override public GeoServerUserGroup createGroupObject(String groupname, boolean isEnabled) throws IOException { GeoServerUserGroup group = new GeoServerUserGroup(groupname); group.setEnabled(isEnabled); return group; }
@Override public SortedSet<GeoServerUserGroup> getUserGroups() { final SortedSet<GeoServerUserGroup> groups = new TreeSet<GeoServerUserGroup>(); authenticateIfNeeded( new AuthenticatedLdapEntryContextCallback() { @Override public void executeWithContext( DirContext ctx, LdapEntryIdentification ldapEntryIdentification) { Set<String> groupNames = LDAPUtils.getLdapTemplateInContext(ctx, template) .searchForSingleAttributeValues( groupSearchBase, allGroupsSearchFilter, new String[] {}, groupNameAttribute); for (String groupName : groupNames) { groups.add(new GeoServerUserGroup(groupName)); } } }); return Collections.unmodifiableSortedSet(groups); }
@PostMapping(value = "/service/{serviceName}/group/{group}") public @ResponseStatus(HttpStatus.CREATED) void insertGroup( @PathVariable("serviceName") String serviceName, @PathVariable("group") String groupName) throws PasswordPolicyException, IOException { GeoServerUserGroupStore store = getStore(serviceName); try { store.addGroup(new GeoServerUserGroup(groupName)); } finally { store.store(); } }
@Override public GeoServerUserGroup getGroupByGroupname(String groupname) { final AtomicReference<GeoServerUserGroup> group = new AtomicReference<GeoServerUserGroup>(); authenticateIfNeeded( new AuthenticatedLdapEntryContextCallback() { @Override public void executeWithContext( DirContext ctx, LdapEntryIdentification ldapEntryIdentification) { try { DirContextOperations dco = LDAPUtils.getLdapTemplateInContext(ctx, template) .searchForSingleEntry( groupSearchBase, groupNameFilter, new String[] {groupname}); if (dco != null) { group.set( new GeoServerUserGroup( dco.getStringAttribute(groupNameAttribute))); } } catch (IncorrectResultSizeDataAccessException e) { } } }); return group.get(); }
@Override public SortedSet<GeoServerUserGroup> getGroupsForUser(final GeoServerUser user) { final SortedSet<GeoServerUserGroup> groups = new TreeSet<GeoServerUserGroup>(); authenticateIfNeeded( new AuthenticatedLdapEntryContextCallback() { @Override public void executeWithContext( DirContext ctx, LdapEntryIdentification ldapEntryIdentification) { Set<String> groupNames = LDAPUtils.getLdapTemplateInContext(ctx, template) .searchForSingleAttributeValues( groupSearchBase, groupMembershipFilter, new String[] { user.getUsername(), lookupDn(user.getUsername()) }, groupNameAttribute); for (String groupName : groupNames) { groups.add(new GeoServerUserGroup(groupName)); } } }); return Collections.unmodifiableSortedSet(groups); }
@Override public void executeWithContext( DirContext ctx, LdapEntryIdentification ldapEntryIdentification) { Set<String> groupNames = LDAPUtils.getLdapTemplateInContext(ctx, template) .searchForSingleAttributeValues( groupSearchBase, allGroupsSearchFilter, new String[] {}, groupNameAttribute); for (String groupName : groupNames) { groups.add(new GeoServerUserGroup(groupName)); } } });
@Override public void executeWithContext( DirContext ctx, LdapEntryIdentification ldapEntryIdentification) { try { DirContextOperations dco = LDAPUtils.getLdapTemplateInContext(ctx, template) .searchForSingleEntry( groupSearchBase, groupNameFilter, new String[] {groupname}); if (dco != null) { group.set( new GeoServerUserGroup( dco.getStringAttribute(groupNameAttribute))); } } catch (IncorrectResultSizeDataAccessException e) { } } });
@Override public void executeWithContext( DirContext ctx, LdapEntryIdentification ldapEntryIdentification) { Set<String> groupNames = LDAPUtils.getLdapTemplateInContext(ctx, template) .searchForSingleAttributeValues( groupSearchBase, groupMembershipFilter, new String[] { user.getUsername(), lookupDn(user.getUsername()) }, groupNameAttribute); for (String groupName : groupNames) { groups.add(new GeoServerUserGroup(groupName)); } } });
"test1.xml"); GeoServerUserGroup group = new GeoServerUserGroup("testgroup");