@Override public void associateRoleToGroup(GeoServerRole role, String groupname) throws IOException { if (filterRole(role) != null && !filterGroup(groupname)) { delegateAsStore().associateRoleToGroup(role, groupname); } }
/** * WRITE_LOCK * * @see * org.geoserver.security.GeoServerRoleStore#associateRoleToGroup(org.geoserver.security.impl.GeoServerRole, * java.lang.String) */ public void associateRoleToGroup(GeoServerRole role, String groupname) throws IOException { writeLock(); try { getStore().associateRoleToGroup(role, groupname); } finally { writeUnLock(); } }
public void associateRoleToGroup(GeoServerRole role, String groupname) throws IOException { checkExistingRoleName(role.getAuthority()); checkValidGroupName(groupname); getStore().associateRoleToGroup(role, groupname); }
store.associateRoleToGroup(newRole, groupname);
public void insertValues(GeoServerRoleStore roleStore) throws IOException { GeoServerRole role_admin = roleStore.createRoleObject(GeoServerRole.ADMIN_ROLE.getAuthority()); GeoServerRole role_auth = roleStore.createRoleObject("ROLE_AUTHENTICATED"); GeoServerRole role_wfs = roleStore.createRoleObject("ROLE_WFS"); GeoServerRole role_wms = roleStore.createRoleObject("ROLE_WMS"); role_auth.getProperties().put("employee", ""); role_auth.getProperties().put("bbox", "lookupAtRuntime"); roleStore.addRole(role_admin); roleStore.addRole(role_auth); roleStore.addRole(role_wfs); roleStore.addRole(role_wms); roleStore.setParentRole(role_wms, role_auth); roleStore.setParentRole(role_wfs, role_auth); roleStore.associateRoleToUser(role_admin, "admin"); roleStore.associateRoleToUser(role_wms, "user1"); roleStore.associateRoleToUser(role_wfs, "user1"); roleStore.associateRoleToGroup(role_wms, "g_wms"); roleStore.associateRoleToGroup(role_wfs, "g_wfs"); roleStore.associateRoleToGroup(role_wms, "g_all"); roleStore.associateRoleToGroup(role_wfs, "g_all"); }
store.associateRoleToGroup(role, "agroup"); assertTrue(store.isModified()); store.store();
gaStore.associateRoleToGroup(role, group.getGroupname()); for (GeoServerRole role : remove) gaStore.disAssociateRoleFromGroup(role, group.getGroupname());
gaStore.associateRoleToGroup(role, group.getGroupname()); for (GeoServerRole role : remove) gaStore.disAssociateRoleFromGroup(role, group.getGroupname());
gaStore.associateRoleToGroup(role, group.getGroupname()); for (GeoServerRole role : remove) gaStore.disAssociateRoleFromGroup(role, group.getGroupname());
role = roleStore.createRoleObject("grouprole1a"); roleStore.addRole(role); roleStore.associateRoleToGroup(role, "theGroup1"); roles.add(role); checkRoles(username, roles); roleStore.associateRoleToGroup(role, "theGroup1"); roles.add(role); checkRoles(username, roles); role = roleStore.createRoleObject("grouprole2a"); roleStore.addRole(role); roleStore.associateRoleToGroup(role, "theGroup2"); checkRoles(username, roles);
@Override protected void onFormSubmit(GeoServerUserGroup group) throws IOException { GeoServerUserGroupStore store=null; try { store = new UserGroupStoreValidationWrapper(getUserGroupStore(userGroupServiceName)); group = store.createGroupObject(group.getGroupname(),group.isEnabled()); store.addGroup(group); store.store(); } catch (IOException ex) { try { store.load(); } catch (IOException ex2) {}; throw ex; } GeoServerRoleStore gaStore=null; try { if (hasRoleStore(getSecurityManager().getActiveRoleService().getName())) { gaStore = getRoleStore(getSecurityManager().getActiveRoleService().getName()); gaStore = new RoleStoreValidationWrapper(gaStore); for (GeoServerRole role : rolePalette.getSelectedRoles()) { gaStore.associateRoleToGroup(role, group.getGroupname()); } gaStore.store(); } } catch (IOException ex) { try {gaStore.load(); } catch (IOException ex2) {}; throw ex; } }
@Override protected void onSetUp(SystemTestData testData) throws Exception { addUser("pippo", "clown", null, Arrays.asList("CIRCUS", "KLINIEK", "ZEVER")); addUser("jantje", "jantje", null, Arrays.asList("MOPJES", "ZEVER")); GeoServerSecurityManager secMgr = getSecurityManager(); GeoServerUserGroupService userGroupService = secMgr.loadUserGroupService("default"); GeoServerRoleService roleService = secMgr.loadRoleService("default"); GeoServerUserGroupStore userGroupStore = userGroupService.createStore(); GeoServerRoleStore rolesStore = roleService.createStore(); GeoServerUser roleUserTest = userGroupService.createUserObject("role_user_test", "role_user_test", true); userGroupStore.addUser(roleUserTest); GeoServerRole roleTest = rolesStore.createRoleObject("ROLE_TEST"); rolesStore.addRole(roleTest); rolesStore.associateRoleToUser(roleTest, "role_user_test"); GeoServerRole roleTest2 = rolesStore.createRoleObject("ROLE_TEST_2"); rolesStore.addRole(roleTest2); GeoServerUserGroup roleGroup = userGroupService.createGroupObject("ROLE_GROUP", true); userGroupStore.addGroup(roleGroup); userGroupStore.associateUserToGroup(roleUserTest, roleGroup); rolesStore.associateRoleToGroup(roleTest2, "ROLE_GROUP"); userGroupStore.store(); rolesStore.store(); }
@Override protected void onFormSubmit(GeoServerUserGroup group) throws IOException { GeoServerUserGroupStore store=null; try { store = new UserGroupStoreValidationWrapper(getUserGroupStore(userGroupServiceName)); group = store.createGroupObject(group.getGroupname(),group.isEnabled()); store.addGroup(group); store.store(); } catch (IOException ex) { try { store.load(); } catch (IOException ex2) {}; throw ex; } GeoServerRoleStore gaStore=null; try { if (hasRoleStore(getSecurityManager().getActiveRoleService().getName())) { gaStore = getRoleStore(getSecurityManager().getActiveRoleService().getName()); gaStore = new RoleStoreValidationWrapper(gaStore); for (GeoServerRole role : rolePalette.getSelectedRoles()) { gaStore.associateRoleToGroup(role, group.getGroupname()); } gaStore.store(); } } catch (IOException ex) { try {gaStore.load(); } catch (IOException ex2) {}; throw ex; } }
gaStore.associateRoleToGroup(role, group.getGroupname());
store2.associateRoleToGroup(role_test2, "agroup"); } catch (IOException ex) { try {