HBASE-13482. Phoenix is failing to scan tables on secure environments. (Alicia Shu)
This commit is contained in:
parent
3baab26d0b
commit
3bf69761e1
|
@ -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.
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue