use of org.apache.ranger.plugin.policyengine.RangerAccessResource in project ranger by apache.
the class RangerOptimizedPolicyEvaluator method isOwnerMatch.
private boolean isOwnerMatch(RangerAccessRequest request) {
boolean ret = false;
if (hasResourceOwner) {
RangerAccessResource accessedResource = request.getResource();
String resourceOwner = accessedResource != null ? accessedResource.getOwnerUser() : null;
String user = request.getUser();
if (user != null && resourceOwner != null && user.equals(resourceOwner)) {
ret = true;
}
}
return ret;
}
use of org.apache.ranger.plugin.policyengine.RangerAccessResource in project ranger by apache.
the class RangerAccessRequestUtil method getCurrentResourceFromContext.
public static RangerAccessResource getCurrentResourceFromContext(Map<String, Object> context) {
RangerAccessResource ret = null;
Object val = context.get(KEY_CONTEXT_RESOURCE);
if (val instanceof RangerAccessResource) {
ret = (RangerAccessResource) val;
}
return ret;
}
use of org.apache.ranger.plugin.policyengine.RangerAccessResource in project ranger by apache.
the class RangerRequestedResources method toString.
StringBuilder toString(StringBuilder sb) {
sb.append("AllRequestedHiveResources={");
for (RangerAccessResource resource : requestedResources) {
if (resource != null) {
sb.append(resource.getAsString());
sb.append("; ");
}
}
sb.append("} ");
return sb;
}
Aggregations