Package org.apache.druid.server.security
Class AuthorizationResult
java.lang.Object
org.apache.druid.server.security.AuthorizationResult
Represents the outcoming of performing authorization check on required resource accesses on a query or http requests.
It contains:
- a boolean allow or deny access results for checking permissions on a list of resource actions.
- a failure message if deny access. It's null when access is allowed.
- a map of table name with optional
Policyrestriction. An empty value means there's no restriction enforced on the table.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AuthorizationResultProvides access with no restrictions to all resources.This should be limited to Druid internal systems or superusers, except in cases where granular ACL considerations are not a priority.static final AuthorizationResultProvides a default deny access result. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if user has all required permission, and the policy restrictions indicates one of the following: no policy found the user has a no-restriction policybooleanReturns true if user has basic access.static AuthorizationResultallowWithRestriction(Map<String, Optional<Policy>> policyRestrictions) static AuthorizationResultbooleanReturns an error string if the AuthorizationResult doesn't permit all requried access.Returns a map of table andPolicyrestriction on the table.inthashCode()toString()
-
Field Details
-
ALLOW_NO_RESTRICTION
Provides access with no restrictions to all resources.This should be limited to Druid internal systems or superusers, except in cases where granular ACL considerations are not a priority. -
DENY
Provides a default deny access result.
-
-
Method Details
-
deny
-
allowWithRestriction
public static AuthorizationResult allowWithRestriction(Map<String, Optional<Policy>> policyRestrictions) -
allowBasicAccess
public boolean allowBasicAccess()Returns true if user has basic access. -
allowAccessWithNoRestriction
public boolean allowAccessWithNoRestriction()Returns true if user has all required permission, and the policy restrictions indicates one of the following:- no policy found
- the user has a no-restriction policy
-
getErrorMessage
Returns an error string if the AuthorizationResult doesn't permit all requried access. -
getPolicyMap
Returns a map of table andPolicyrestriction on the table. Empty value means the table doesn't have any restriction. -
equals
-
hashCode
public int hashCode() -
toString
-