Tabnine Logo
GeoServerRole.getAuthority
Code IndexAdd Tabnine to your IDE (free)

How to use
getAuthority
method
in
org.geoserver.security.impl.GeoServerRole

Best Java code snippets using org.geoserver.security.impl.GeoServerRole.getAuthority (Showing top 20 results out of 315)

origin: geoserver/geoserver

protected void checkRole(GeoServerRole role) {
  if (helper.roleMap.containsKey(role.getAuthority()) == false)
    throw new IllegalArgumentException("Role: " + role.getAuthority() + " does not exist");
}
origin: geoserver/geoserver

public void updateRole(GeoServerRole role) throws IOException {
  if (helper.roleMap.containsKey(role.getAuthority())) {
    helper.roleMap.put(role.getAuthority(), role);
    setModified(true);
  } else
    throw new IllegalArgumentException(
        "The role " + role.getAuthority() + " does not exist");
}
origin: geoserver/geoserver

public void addRole(GeoServerRole role) throws IOException {
  if (helper.roleMap.containsKey(role.getAuthority()))
    throw new IllegalArgumentException(
        "The role " + role.getAuthority() + " already exists");
  else {
    helper.roleMap.put(role.getAuthority(), role);
    setModified(true);
  }
}
origin: geoserver/geoserver

public Map<String, String> getParentMappings() throws IOException {
  Map<String, String> parentMap = new HashMap<String, String>();
  for (GeoServerRole role : roleMap.values()) {
    GeoServerRole parentRole = role_parentMap.get(role);
    parentMap.put(
        role.getAuthority(), parentRole == null ? null : parentRole.getAuthority());
  }
  return Collections.unmodifiableMap(parentMap);
}
origin: geoserver/geoserver

public void validate(SecurityRoleServiceConfig config) throws SecurityConfigException {
  for (GeoServerRole systemRole : GeoServerRole.SystemRoles) {
    if (systemRole.getAuthority().equals(config.getAdminRoleName()))
      throw createSecurityException(RESERVED_ROLE_NAME, systemRole.getAuthority());
    if (systemRole.getAuthority().equals(config.getGroupAdminRoleName()))
      throw createSecurityException(RESERVED_ROLE_NAME, systemRole.getAuthority());
  }
}
origin: geoserver/geoserver

protected void checkReservedNames(String roleName) throws IOException {
  for (GeoServerRole systemRole : GeoServerRole.SystemRoles) {
    if (systemRole.getAuthority().equals(roleName))
      throw createSecurityException(RESERVED_NAME, roleName);
  }
}
origin: geoserver/geoserver

public int compareTo(GeoServerRole o) {
  if (o == null) return 1;
  if (getAuthority().equals(o.getAuthority())) {
    if (getUserName() == null && o.getUserName() == null) return 0;
    if (getUserName() == null) return -1;
    if (o.getUserName() == null) return 1;
    return getUserName().compareTo(o.getUserName());
  }
  return getAuthority().compareTo(o.getAuthority());
}
origin: geoserver/geoserver

public int hashCode() {
  int hash = getAuthority().hashCode();
  if (getUserName() != null) hash += getUserName().hashCode();
  return hash;
}
origin: geoserver/geoserver

public void addRole(GeoServerRole role) throws IOException {
  checkReservedNames(role.getAuthority());
  checkNotExistingRoleName(role.getAuthority());
  checkNotExistingInOtherServices(role.getAuthority());
  getStore().addRole(role);
}
origin: geoserver/geoserver

  public void setParentRole(GeoServerRole role, GeoServerRole parentRole) throws IOException {
    checkExistingRoleName(role.getAuthority());
    if (parentRole != null) checkExistingRoleName(parentRole.getAuthority());
    getStore().setParentRole(role, parentRole);
  }
}
origin: geoserver/geoserver

public SortedSet<String> getUserNamesForRole(GeoServerRole role) throws IOException {
  checkExistingRoleName(role.getAuthority());
  return service.getUserNamesForRole(role);
}
origin: geoserver/geoserver

public GeoServerRole getParentRole(GeoServerRole role) throws IOException {
  checkExistingRoleName(role.getAuthority());
  return service.getParentRole(role);
}
origin: geoserver/geoserver

public SortedSet<String> getGroupNamesForRole(GeoServerRole role) throws IOException {
  checkExistingRoleName(role.getAuthority());
  return service.getGroupNamesForRole(role);
}
origin: geoserver/geoserver

public void updateRole(GeoServerRole role) throws IOException {
  checkExistingRoleName(role.getAuthority());
  getStore().updateRole(role);
}
origin: geoserver/geoserver

/**
 * Checks if the roles is mapped to a system role, see
 *
 * <p>{@link SecurityRoleServiceConfig#getAdminRoleName()} {@link
 * SecurityRoleServiceConfig#getGroupAdminRoleName()}
 *
 * @param role
 * @throws IOException
 */
public void checkRoleIsMapped(GeoServerRole role) throws IOException {
  GeoServerRole mappedRole = service.getAdminRole();
  if (mappedRole != null && mappedRole.equals(role))
    throw createSecurityException(ADMIN_ROLE_NOT_REMOVABLE_$1, role.getAuthority());
  mappedRole = service.getGroupAdminRole();
  if (mappedRole != null && mappedRole.equals(role))
    throw createSecurityException(GROUP_ADMIN_ROLE_NOT_REMOVABLE_$1, role.getAuthority());
}
origin: geoserver/geoserver

public void associateRoleToUser(GeoServerRole role, String username) throws IOException {
  checkExistingRoleName(role.getAuthority());
  checkValidUserName(username);
  getStore().associateRoleToUser(role, username);
}
origin: geoserver/geoserver

public void disAssociateRoleFromUser(GeoServerRole role, String username) throws IOException {
  checkExistingRoleName(role.getAuthority());
  checkValidUserName(username);
  getStore().disAssociateRoleFromUser(role, username);
}
origin: geoserver/geoserver

public void disAssociateRoleFromGroup(GeoServerRole role, String groupname) throws IOException {
  checkExistingRoleName(role.getAuthority());
  checkValidGroupName(groupname);
  getStore().disAssociateRoleFromGroup(role, groupname);
}
origin: geoserver/geoserver

public void associateRoleToGroup(GeoServerRole role, String groupname) throws IOException {
  checkExistingRoleName(role.getAuthority());
  checkValidGroupName(groupname);
  getStore().associateRoleToGroup(role, groupname);
}
origin: geoserver/geoserver

protected void checkValuesRemoved(GeoServerRoleService roleService) throws IOException {
  GeoServerRole role_admin =
      roleService.getRoleByName(GeoServerRole.ADMIN_ROLE.getAuthority());
  GeoServerRole role_wms = roleService.getRoleByName("ROLE_WMS");
  assertEquals(2, roleService.getRoles().size());
  assertEquals(2, roleService.getRoleCount());
  assertTrue(roleService.getRoles().contains(role_admin));
  assertTrue(roleService.getRoles().contains(role_wms));
  assertNull(roleService.getParentRole(role_wms));
  assertEquals(1, roleService.getRolesForUser("user1").size());
  assertTrue(roleService.getRolesForUser("user1").contains(role_wms));
  assertEquals(0, roleService.getRolesForGroup("g_wfs").size());
  assertEquals(1, roleService.getRolesForGroup("g_all").size());
  assertTrue(roleService.getRolesForGroup("g_all").contains(role_wms));
}
org.geoserver.security.implGeoServerRolegetAuthority

Popular methods of GeoServerRole

  • <init>
  • getProperties
  • getUserName
  • setUserName
  • equals
  • toString
  • compareTo
  • equalsWithoutUserName
  • isAnonymous

Popular in Java

  • Start an intent from android
  • onCreateOptionsMenu (Activity)
  • getResourceAsStream (ClassLoader)
  • notifyDataSetChanged (ArrayAdapter)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Notification (javax.management)
  • JCheckBox (javax.swing)
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now