public class SentryIndexAuthorizationSingleton extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
propertyName |
| Modifier and Type | Method and Description |
|---|---|
void |
authorizeAdminAction(SolrQueryRequest req,
Set<org.apache.sentry.core.model.search.SearchModelAction> actions,
String operation,
boolean checkCollection,
String collection)
Attempt to authorize an administrative action.
|
void |
authorizeCollectionAction(SolrQueryRequest req,
Set<org.apache.sentry.core.model.search.SearchModelAction> actions,
String operation)
Attempt to authorize a collection action.
|
void |
authorizeCollectionAction(SolrQueryRequest req,
Set<org.apache.sentry.core.model.search.SearchModelAction> actions,
String operation,
String collectionName,
boolean errorIfNoCollection)
Attempt to authorize a collection action.
|
static SentryIndexAuthorizationSingleton |
getInstance() |
Set<String> |
getRoles(String userName)
Get the roles associated with the user
|
String |
getUserName(SolrQueryRequest req)
Get the user name associated with the request
|
boolean |
isEnabled()
Returns true iff Sentry index authorization checking is enabled
|
public static final String propertyName
public static SentryIndexAuthorizationSingleton getInstance()
public boolean isEnabled()
public void authorizeAdminAction(SolrQueryRequest req, Set<org.apache.sentry.core.model.search.SearchModelAction> actions, String operation, boolean checkCollection, String collection) throws SolrException
req - request to checkactions - set of actions to checkcheckCollection - check the collection the action is on, or only "admin"?collection - only relevant if checkCollection==true,
use collection (if non-null) instead pulling collection name from req (if null)SolrExceptionpublic void authorizeCollectionAction(SolrQueryRequest req, Set<org.apache.sentry.core.model.search.SearchModelAction> actions, String operation) throws SolrException
SolrExceptionpublic void authorizeCollectionAction(SolrQueryRequest req, Set<org.apache.sentry.core.model.search.SearchModelAction> actions, String operation, String collectionName, boolean errorIfNoCollection) throws SolrException
req - request to checkactions - set of actions to checkcollectionName - the collection to check. If null, the collection
name is pulled from the requesterrorIfNoCollection - is true, throw an exception if collection
cannot be locatedSolrExceptionpublic Set<String> getRoles(String userName)
userName - to get roles forpublic String getUserName(SolrQueryRequest req) throws SolrException
req - the requestSolrExceptionCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.