Codota Logo
GroupAdminProperty
Code IndexAdd Codota to your IDE (free)

How to use
GroupAdminProperty
in
org.geoserver.security.impl

Best Java code snippets using org.geoserver.security.impl.GroupAdminProperty (Showing top 12 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: geoserver/geoserver

public static String[] get(Properties props) {
  String val = (String) props.get(INSTANCE.getKey());
  return val != null && !"".equals(val) ? INSTANCE.fromString(val) : null;
}
origin: geoserver/geoserver

public static void set(Properties props, String[] value) {
  props.put(INSTANCE.getKey(), value != null ? INSTANCE.toString(value) : "");
}
origin: org.geoserver.web/web-sec-core

  @Override
  public void onSubmit() {
    try {
      //update the user property listing the group names the user is admin for
      if (adminGroupChoice.isEnabled()) {
        Collection<GeoServerUserGroup> groups = adminGroupChoice.getModelObject();
        String[] groupNames = new String[groups.size()];
        int i = 0;
        for (GeoServerUserGroup group : groups) {
          groupNames[i++] = group.getGroupname();
        }
        GroupAdminProperty.set(user.getProperties(), groupNames);
      }
      else {
        GroupAdminProperty.del(user.getProperties());
      }
      onFormSubmit(user);
      setReturnPageDirtyAndReturn(true);
    }
    catch(Exception e) {
      handleSubmitError(e);
    }
  }
}.setEnabled(hasUserGroupStore || hasRoleStore(getSecurityManager().getActiveRoleService().getName())));
origin: org.geoserver.web/web-security

List<GeoServerUserGroup> adminGroups = new ArrayList();
if (isGroupAdmin) {
  for (String groupName : GroupAdminProperty.get(user.getProperties())) {
    try {
      adminGroups.add(ugService.getGroupByGroupname(groupName));
origin: geoserver/geoserver

List<String> calculateAdminGroups(UserDetails userDetails) throws IOException {
  if (userDetails instanceof GeoServerUser) {
    Properties props = ((GeoServerUser) userDetails).getProperties();
    if (GroupAdminProperty.has(props)) {
      return Arrays.asList(GroupAdminProperty.get(props));
    }
  }
  // fall back on including every group the user is part of
  List<String> groupNames = new ArrayList<String>();
  for (GeoServerUserGroupService ugService : loadUserGroupServices()) {
    GeoServerUser user = ugService.getUserByUsername(userDetails.getUsername());
    if (user != null) {
      for (GeoServerUserGroup group : ugService.getGroupsForUser(user)) {
        groupNames.add(group.getGroupname());
      }
    }
  }
  return groupNames;
}
origin: org.geoserver.security/gs-security-tests

@Override
protected void onSetUp(SystemTestData testData) throws Exception {
  super.onSetUp(testData);
  // set up the services
  GeoServerUserGroupService ugService = createUserGroupService("gaugs");
  GeoServerRoleService roleService = createRoleService("gars");
  getSecurityManager().setActiveRoleService(roleService);
  // add the users
  GeoServerUserGroupStore ugStore = createStore(ugService);
  GeoServerUser bob = ugStore.createUserObject("bob", "foobar", true);
  GroupAdminProperty.set(bob.getProperties(), new String[] {"users"});
  ugStore.addUser(bob);
  GeoServerUser alice = ugStore.createUserObject("alice", "foobar", true);
  ugStore.addUser(alice);
  GeoServerUserGroup users = ugStore.createGroupObject("users", true);
  ugStore.addGroup(users);
  GeoServerUserGroup admins = ugStore.createGroupObject("admins", true);
  ugStore.addGroup(admins);
  ugStore.store();
  // grant bob group admin privilege
  GeoServerRole groupAdminRole = null;
  GeoServerRoleStore roleStore = createStore(roleService);
  roleStore.addRole(roleStore.createRoleObject("adminRole"));
  roleStore.addRole(groupAdminRole = roleStore.createRoleObject("groupAdminRole"));
  roleStore.associateRoleToUser(groupAdminRole, bob.getUsername());
  roleStore.store();
}
origin: geoserver/geoserver

  public static boolean has(Properties props) {
    return props.containsKey(INSTANCE.getKey());
  }
}
origin: org.geoserver.web/web-security

  @Override
  public void onSubmit() {
    try {
      //update the user property listing the group names the user is admin for
      if (adminGroupChoice.isEnabled()) {
        Collection<GeoServerUserGroup> groups = adminGroupChoice.getModelObject();
        String[] groupNames = new String[groups.size()];
        int i = 0;
        for (GeoServerUserGroup group : groups) {
          groupNames[i++] = group.getGroupname();
        }
        GroupAdminProperty.set(user.getProperties(), groupNames);
      }
      else {
        GroupAdminProperty.del(user.getProperties());
      }
      onFormSubmit(user);
      setReturnPageDirtyAndReturn(true);
    }
    catch(Exception e) {
      handleSubmitError(e);
    }
  }
}.setEnabled(hasUserGroupStore || hasRoleStore(getSecurityManager().getActiveRoleService().getName())));
origin: org.geoserver.web/web-sec-core

List<GeoServerUserGroup> adminGroups = new ArrayList();
if (isGroupAdmin) {
  for (String groupName : GroupAdminProperty.get(user.getProperties())) {
    try {
      adminGroups.add(ugService.getGroupByGroupname(groupName));
origin: geoserver/geoserver

public static void del(Properties props) {
  props.remove(INSTANCE.getKey());
}
origin: org.geoserver.web/gs-web-sec-core

  @Override
  public void onSubmit() {
    try {
      // update the user property listing the group names the user is admin
      // for
      if (adminGroupChoice.isEnabled()) {
        Collection<GeoServerUserGroup> groups =
            adminGroupChoice.getModelObject();
        String[] groupNames = new String[groups.size()];
        int i = 0;
        for (GeoServerUserGroup group : groups) {
          groupNames[i++] = group.getGroupname();
        }
        GroupAdminProperty.set(user.getProperties(), groupNames);
      } else {
        GroupAdminProperty.del(user.getProperties());
      }
      onFormSubmit(user);
      setReturnPageDirtyAndReturn(true);
    } catch (Exception e) {
      handleSubmitError(e);
    }
  }
}.setEnabled(
origin: org.geoserver.web/gs-web-sec-core

List<GeoServerUserGroup> adminGroups = new ArrayList();
if (isGroupAdmin) {
  for (String groupName : GroupAdminProperty.get(user.getProperties())) {
    try {
      adminGroups.add(ugService.getGroupByGroupname(groupName));
org.geoserver.security.implGroupAdminProperty

Javadoc

User property that stores list of groups that a user has GeoServerRole#GROUP_ADMIN_ROLEprivileges for.

Most used methods

  • get
  • set
  • del
  • fromString
  • getKey
  • has
  • toString

Popular in Java

  • Finding current android device location
  • onRequestPermissionsResult (Fragment)
  • setScale (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • Logger (org.slf4j)
    The main user interface to logging. It is expected that logging takes place through concrete impleme
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now