K
- T
- AbstractAuthorizableConfiguration
with DefaultConfigurationService
isntead@Deprecated public class ConfigurationSourceWithAuthorizableConfigs<K,T> extends Object implements ConfigurationSource<K,T>
ConfigurationSource
wrapper that checks for Authorization on any configurations that are Authorizable
.
The authorization is applicable only to Valid/existing configurations and this should be respected by all interfaces.ConfigurationSource
's without
disrupting the iteration with exceptions for invalid config requests for any particular Source that maybe valid in another source.
Agreed, this could also be the responsibility of the calling API, however the assumption that null values are excluded does allow a cleaner and more sensible implementation.NAMESPACE_DELIM
Constructor and Description |
---|
ConfigurationSourceWithAuthorizableConfigs()
Deprecated.
|
ConfigurationSourceWithAuthorizableConfigs(IAuthorizationService authorizationService,
ConfigurationSource<K,T> source)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected void |
filter(User user,
Authorizable authorizable)
Deprecated.
Authorization filter for
User By default there is no additional Authorization check; however one is encouraged to override this and check the User in the request for any additional authorizations. |
Map<K,T> |
get(String namespace)
Deprecated.
Get a Map of key name and corresponding
IConfiguration for the specific namespace. |
T |
get(String namespace,
K key)
Deprecated.
|
T |
get(User user,
String namespace,
K key)
Deprecated.
Get a configuration in the context to a
User |
protected Authorizable |
getAuthorizableForConfig(String namespace,
K key)
Deprecated.
Map a namespace and key to an
Authorizable instance.By default configIdToAuthorizableMap is used for this mapping. |
IAuthorizationService |
getAuthorizationService()
Deprecated.
|
Map<Serializable,Authorizable> |
getConfigIdToAuthorizableMap()
Deprecated.
|
ConfigurationSource<K,T> |
getSource()
Deprecated.
|
void |
setAuthorizationService(IAuthorizationService authorizationService)
Deprecated.
|
void |
setConfigIdToAuthorizableMap(Map<Serializable,Authorizable> configIdToAuthorizableMap)
Deprecated.
|
void |
setSource(ConfigurationSource<K,T> source)
Deprecated.
|
public ConfigurationSourceWithAuthorizableConfigs()
public ConfigurationSourceWithAuthorizableConfigs(IAuthorizationService authorizationService, ConfigurationSource<K,T> source)
protected void filter(User user, Authorizable authorizable) throws AuthorizationException
User
AuthorizationServiceException
- if user not Authorized for the ServiceAuthorizationException
protected Authorizable getAuthorizableForConfig(String namespace, K key)
Authorizable
instance.configIdToAuthorizableMap
is used for this mapping. One can override for custom logic and
implementations.
Pattern
definednamespace
- as Stringkey
- as KAuthorizable
@nullable true, if no match foundpublic T get(String namespace, K key)
get
in interface ConfigurationSource<K,T>
namespace
- as Stringkey
- as Kpublic T get(User user, String namespace, K key)
ConfigurationSource
User
get
in interface ConfigurationSource<K,T>
public Map<K,T> get(String namespace)
ConfigurationSource
IConfiguration
for the specific namespace.
get
in interface ConfigurationSource<K,T>
namespace
- as StringIConfiguration
public ConfigurationSource<K,T> getSource()
public void setSource(ConfigurationSource<K,T> source)
public IAuthorizationService getAuthorizationService()
public void setAuthorizationService(IAuthorizationService authorizationService)
public Map<Serializable,Authorizable> getConfigIdToAuthorizableMap()
public void setConfigIdToAuthorizableMap(Map<Serializable,Authorizable> configIdToAuthorizableMap)
Copyright © 2018. All rights reserved.