private void rebuildAuthorizationTree(boolean force) { long daoLastModified = dao.getLastModified(); if (lastLoaded < daoLastModified || force) { root = buildAuthorizationTree(dao); lastLoaded = daoLastModified; } }
/** * Convenience method for {@link #calculateRoles(GeoServerUser)} * * @param username * @throws IOException */ public SortedSet<GeoServerRole> calculateRoles(String username) throws IOException { return calculateRoles(new GeoServerUser(username)); }
/** * Pass a reference to the raw, unsecured catalog. The reference is used to evaluate the * relationship between layers and the groups containing them * * @param dao * @param rawCatalog */ public DefaultResourceAccessManager(DataAccessRuleDAO dao, Catalog rawCatalog) { this.dao = dao; this.rawCatalog = rawCatalog; this.root = buildAuthorizationTree(dao); this.groupsCache = new LayerGroupContainmentCache(rawCatalog); }
public GeoServerUser createUserObject(String username, String password, boolean isEnabled) throws IOException { GeoServerUser user = new GeoServerUser(username); user.setEnabled(isEnabled); user.setPassword(password); return user; }
public GeoServerUserGroup createGroupObject(String groupname, boolean isEnabled) throws IOException { GeoServerUserGroup group = new GeoServerUserGroup(groupname); group.setEnabled(isEnabled); return group; }
@Override public GeoServerUser createUserObject(String username, String password, boolean isEnabled) throws IOException { GeoServerUser user = new MemoryGeoserverUser(username, this); user.setEnabled(isEnabled); user.setPassword(password); return user; }
@Override public GeoServerUserGroup createGroupObject(String groupname, boolean isEnabled) throws IOException { GeoServerUserGroup group = new MemoryGeoserverUserGroup(groupname); group.setEnabled(isEnabled); return group; } }
@Override public GeoServerRoleStore createStore() throws IOException { MemoryRoleStore store = new MemoryRoleStore(); store.initializeFromService(this); return store; }
/** Equality based on ws/layer/mode only */ @Override public boolean equals(Object obj) { if (!(obj instanceof DataAccessRule)) return false; return 0 == compareTo((DataAccessRule) obj); }
@Override public void initializeFromService(GeoServerUserGroupService service) throws IOException { this.service = (AbstractUserGroupService) service; load(); }
/** Delegates to the {@link GeoServerUserGroupService} backend */ @Override public GeoServerUser createUserObject(String username, String password, boolean isEnabled) throws IOException { return service.createUserObject(username, password, isEnabled); }
@Override public int getUserCountHavingPropertyValue(String propname, String propvalue) throws IOException { return helper.getUserCountHavingPropertyValue(propname, propvalue); } }
@Override public SortedSet<GeoServerUser> getUsersHavingPropertyValue(String propname, String propvalue) throws IOException { return helper.getUsersHavingPropertyValue(propname, propvalue); }
public static String encodePasswordInA1Format(String username, String realm, String password) { String a1 = username + ":" + realm + ":" + password; String a1Md5 = md5Hex(a1); return a1Md5; }
@Override public SecurityConfigValidator createConfigurationValidator( GeoServerSecurityManager securityManager) { return new MemorySecurityConfigValidator(securityManager); } }
@Override public GeoServerRole createRoleObject(String role) throws IOException { return new MemoryGeoserverRole(role); } }
@Override public GeoServerUserGroupService createUserGroupService(SecurityNamedServiceConfig config) throws IOException { return new ReadOnlyUGService(); }
@Override public GeoServerRoleService createRoleService(SecurityNamedServiceConfig config) throws IOException { return new ReadOnlyRoleService(); }
public MemoryDataAccessRuleDAO(Catalog rawCatalog, Properties props) throws ConfigurationException { super(rawCatalog, null); loadRules(props); }
@Override public GeoServerUserGroup createGroupObject(String groupname, boolean isEnabled) throws IOException { GeoServerUserGroup group = new MemoryGeoserverUserGroup(groupname); group.setEnabled(isEnabled); return group; }