Package org.apache.solr.security
Class RuleBasedAuthorizationPlugin
- java.lang.Object
-
- org.apache.solr.security.RuleBasedAuthorizationPluginBase
-
- org.apache.solr.security.RuleBasedAuthorizationPlugin
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.solr.common.SpecProvider
,AuthorizationPlugin
,ConfigEditablePlugin
public class RuleBasedAuthorizationPlugin extends RuleBasedAuthorizationPluginBase
Original implementation of Rule Based Authz plugin which configures user/role mapping in the security.json configuration
-
-
Constructor Summary
Constructors Constructor Description RuleBasedAuthorizationPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
getUserRoles(Principal principal)
Look up user's role from the explicit user-role mapping.Set<String>
getUserRoles(AuthorizationContext context)
Finds user rolesvoid
init(Map<String,Object> initInfo)
-
Methods inherited from class org.apache.solr.security.RuleBasedAuthorizationPluginBase
authorize, close, doesUserHavePermission, edit, getPermissionNamesForRoles, getSpec
-
-
-
-
Method Detail
-
init
public void init(Map<String,Object> initInfo)
- Specified by:
init
in interfaceAuthorizationPlugin
- Overrides:
init
in classRuleBasedAuthorizationPluginBase
-
getUserRoles
public Set<String> getUserRoles(AuthorizationContext context)
Description copied from class:RuleBasedAuthorizationPluginBase
Finds user roles- Overrides:
getUserRoles
in classRuleBasedAuthorizationPluginBase
- Parameters:
context
- the authorization context to load roles from- Returns:
- set of roles as strings or empty set if no roles are found
-
getUserRoles
public Set<String> getUserRoles(Principal principal)
Look up user's role from the explicit user-role mapping.- Specified by:
getUserRoles
in classRuleBasedAuthorizationPluginBase
- Parameters:
principal
- the user Principal from the request- Returns:
- set of roles as strings
-
-