Package org.geoserver.security

Examples of org.geoserver.security.GeoServerRoleStore.store()


        ugStore.store();
       
        GeoServerRoleStore roleStore =  roleService.createStore();
        roleStore.addRole(GeoServerRole.ADMIN_ROLE);
        roleStore.associateRoleToUser(GeoServerRole.ADMIN_ROLE, sa.getUsername());
        roleStore.store();
        getSecurityManager().setActiveRoleService(roleService);
       
       
        UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken("sa","");
        token.setDetails("details");
View Full Code Here


       
       
        GeoServerRoleStore roleStore =  roleService.createStore();
        roleStore.addRole(GeoServerRole.ADMIN_ROLE);
        roleStore.associateRoleToUser(GeoServerRole.ADMIN_ROLE, "sa");
        roleStore.store();
        getSecurityManager().setActiveRoleService(roleService);
       
       
        UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken("sa","");
        token.setDetails("details");
View Full Code Here

        rstore.addRole(root=rstore.createRoleObject(rootRole));
        rstore.addRole(derived=rstore.createRoleObject(derivedRole));
        rstore.setParentRole(derived, root);
        rstore.associateRoleToUser(derived, testUserName);
        rstore.associateRoleToUser(derived, "castest");
        rstore.store();
       
        SecurityManagerConfig mconfig = getSecurityManager().loadSecurityConfig();
        mconfig.setRoleServiceName("rs1");
        getSecurityManager().saveSecurityConfig(mconfig);
       
View Full Code Here

                }

                roleStore.associateRoleToUser(role, username);
            }

            roleStore.store();
        }
    }

    protected void addLayerAccessRule(String workspace, String layer, AccessMode mode, String... roles) throws IOException {
        DataAccessRuleDAO dao = DataAccessRuleDAO.get();
View Full Code Here

        roleStore.associateRoleToUser(role, "cite_noinfo");
        roleStore.associateRoleToUser(role, "cite_nostates");
        roleStore.associateRoleToUser(role, "cite_cite_texas");
        roleStore.associateRoleToUser(role, "cite_mosaic1");
        roleStore.associateRoleToUser(role, "cite_mosaic2");
        roleStore.store();
       
        prepare();
    }
//    /**
//     * Add the users
View Full Code Here

            GeoServerRoleService service = securityManager.loadRoleService(serviceName);
            if (service.canCreateStore()) {
                GeoServerRoleStore store = service.createStore();
                store.clear();
                store.store();
            }

            SecurityRoleServiceConfig old = securityManager.loadRoleServiceConfig(serviceName);
            securityManager.removeRoleService(old);
          
View Full Code Here

       
        store.associateRoleToUser(adminRole, "user1");
        store.associateRoleToUser(groupAdminRole, "user1");
        store.associateRoleToUser(adminRole, "user2");
        store.associateRoleToUser(role1, "user3");
        store.store();
    
        MemoryUserGroupServiceConfigImpl ugconfig = new MemoryUserGroupServiceConfigImpl();        
        ugconfig.setName("testAdminRole");       
        ugconfig.setClassName(MemoryUserGroupService.class.getName());
        ugconfig.setPasswordEncoderName(getPBEPasswordEncoder().getName());
View Full Code Here

                for (GeoServerRole role : add)
                    gaStore.associateRoleToGroup(role, group.getGroupname());
                for (GeoServerRole role : remove)
                    gaStore.disAssociateRoleFromGroup(role, group.getGroupname());       
                gaStore.store();
            }       
        } catch (IOException ex) {
            try {gaStore.load(); } catch (IOException ex2) {};
            throw ex;
        }
View Full Code Here

                            GeoServerApplication.get().getSecurityManager().loadRoleService(roleServiceName);
                    gaStore = new RoleStoreValidationWrapper(gaService.createStore());
                    for (GeoServerRole role : removePanel.getRoots()) {                    
                         gaStore.removeRole(role);
                    }
                    gaStore.store();
                } catch (IOException ex) {
                    try {gaStore.load(); } catch (IOException ex2) {};
                    throw new RuntimeException(ex);
                }
                // the deletion will have changed what we see in the page
View Full Code Here

        }
        if (fail)
            Assert.fail(failMessage);
       
        // release lock
        store2.store();
        store1.clear();
        store1.store();
       
        //// end of part one, now check all modifying methods
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.