@Override protected String load() { try { GeoServerRole parentRole = getRoleService(roleServiceName).getParentRole(role); return parentRole != null ? parentRole.getAuthority() : null; } catch (IOException e) { throw new RuntimeException(e); } } }
protected AbstractRolePage(String roleService,GeoServerRole role) { this.roleServiceName = roleService; boolean hasRoleStore = hasRoleStore(roleServiceName); add(form); descriptionModel = new StringResourceModel("anonymousRole", getPage(), null); descriptionModel = new StringResourceModel("personalizedRole", getPage(), null, new Object[]{role.getUserName()}); form.add(getCancelLink());
@Override public void onSubmit() { try { onFormSubmit((GeoServerRole) getForm().getModelObject()); setReturnPageDirtyAndReturn(true); } catch (IOException e) { if (e.getCause() instanceof AbstractSecurityException) { error(e.getCause()); } else { error(new ParamResourceModel("saveError", getPage(), e.getMessage()).getObject()); } LOGGER.log(Level.SEVERE, "Error occurred while saving role", e); } } }.setVisible(hasRoleStore));
protected AbstractRolePage(String roleService,GeoServerRole role) { this.roleServiceName = roleService; boolean hasRoleStore = hasRoleStore(roleServiceName); add(form); descriptionModel = new StringResourceModel("personalizedRole", getPage(), null, new Object[]{role.getUserName()}); descriptionModel = new StringResourceModel("anonymousRole", getPage(), null); form.add(getCancelLink());
@Override public void onSubmit() { try { onFormSubmit((GeoServerRole) getForm().getModelObject()); setReturnPageDirtyAndReturn(true); } catch (IOException e) { if (e.getCause() instanceof AbstractSecurityException) { error(e.getCause()); } else { error(new ParamResourceModel("saveError", getPage(), e.getMessage()).getObject()); } LOGGER.log(Level.SEVERE, "Error occurred while saving role", e); } } }.setVisible(hasRoleStore));
protected AbstractRolePage(String roleService, GeoServerRole role) { this.roleServiceName = roleService; boolean hasRoleStore = hasRoleStore(roleServiceName); add(form); new StringResourceModel("personalizedRole", getPage()) .setParameters(role.getUserName()); } else { descriptionModel = new StringResourceModel("anonymousRole", getPage()); form.add(getCancelLink());
@Override protected String load() { try { GeoServerRole parentRole = getRoleService(roleServiceName).getParentRole(role); return parentRole != null ? parentRole.getAuthority() : null; } catch (IOException e) { throw new RuntimeException(e); } } }
@Override public void onSubmit() { try { onFormSubmit((GeoServerRole) getForm().getModelObject()); setReturnPageDirtyAndReturn(true); } catch (IOException e) { if (e.getCause() instanceof AbstractSecurityException) { error(e.getCause()); } else { error( new ParamResourceModel( "saveError", getPage(), e.getMessage()) .getObject()); } LOGGER.log(Level.SEVERE, "Error occurred while saving role", e); } } }.setVisible(hasRoleStore));
@Override protected String load() { try { GeoServerRole parentRole = getRoleService(roleServiceName).getParentRole(role); return parentRole != null ? parentRole.getAuthority() : null; } catch (IOException e) { throw new RuntimeException(e); } } }
List<String> computeAllowableParentRoles(GeoServerRole role) throws IOException { Map<String, String> parentMappings = getRoleService(roleServiceName).getParentMappings(); if (role != null && StringUtils.hasLength(role.getAuthority())) { // filter out roles already used as parents RoleHierarchyHelper helper = new RoleHierarchyHelper(parentMappings); Set<String> parents = new HashSet<String>(parentMappings.keySet()); parents.removeAll(helper.getDescendants(role.getAuthority())); parents.remove(role.getAuthority()); return new ArrayList(parents); } else { // no rolename given, we are creating a new one return new ArrayList(parentMappings.keySet()); } }
List<String> computeAllowableParentRoles(GeoServerRole role) throws IOException { Map<String, String> parentMappings = getRoleService(roleServiceName).getParentMappings(); if (role != null && StringUtils.hasLength(role.getAuthority())) { //filter out roles already used as parents RoleHierarchyHelper helper = new RoleHierarchyHelper(parentMappings); Set<String> parents = new HashSet<String>(parentMappings.keySet()); parents.removeAll(helper.getDescendants(role.getAuthority())); parents.remove(role.getAuthority()); return new ArrayList(parents); } else { // no rolename given, we are creating a new one return new ArrayList(parentMappings.keySet()); } }
List<String> computeAllowableParentRoles(GeoServerRole role) throws IOException { Map<String, String> parentMappings = getRoleService(roleServiceName).getParentMappings(); if (!role.getAuthority().equals(GeoServerRole.NULL_ROLE.getAuthority()) ) { //filter out roles already used as parents RoleHierarchyHelper helper = new RoleHierarchyHelper(parentMappings); Set<String> parents = new HashSet<String>(parentMappings.keySet()); parents.removeAll(helper.getDescendants(role.getAuthority())); parents.remove(role.getAuthority()); return new ArrayList(parents); } else { // no rolename given, we are creating a new one return new ArrayList(parentMappings.keySet()); } }