HBASE-13482. Phoenix is failing to scan tables on secure environments. (Alicia Shu)

This commit is contained in:
Devaraj Das 2015-04-19 22:17:38 -07:00
parent 3baab26d0b
commit 3bf69761e1
3 changed files with 8 additions and 1 deletions

View File

@ -2390,6 +2390,10 @@ public class RpcServer implements RpcServerInterface {
return CurCall.get();
}
public static boolean isInRpcCallContext() {
return CurCall.get() != null;
}
/**
* Returns the user credentials associated with the current RPC request or
* <code>null</code> if no credentials were provided.

View File

@ -2053,6 +2053,8 @@ public class AccessController extends BaseMasterAndRegionObserver
* the checks performed in preScannerOpen()
*/
private void requireScannerOwner(InternalScanner s) throws AccessDeniedException {
if (!RpcServer.isInRpcCallContext())
return;
String requestUserName = RpcServer.getRequestUserName();
String owner = scannerOwners.get(s);
if (authorizationEnabled && owner != null && !owner.equals(requestUserName)) {

View File

@ -638,7 +638,8 @@ public class VisibilityController extends BaseMasterAndRegionObserver implements
* access control is correctly enforced based on the checks performed in preScannerOpen()
*/
private void requireScannerOwner(InternalScanner s) throws AccessDeniedException {
// This is duplicated code!
if (!RpcServer.isInRpcCallContext())
return;
String requestUName = RpcServer.getRequestUserName();
String owner = scannerOwners.get(s);
if (authorizationEnabled && owner != null && !owner.equals(requestUName)) {