@Deprecated
  public static List<UserPermission> getUserPermissions(RpcController controller,
    AccessControlService.BlockingInterface protocol, byte[] namespace, String userName)
    throws ServiceException {
    AccessControlProtos.GetUserPermissionsRequest.Builder builder =
      AccessControlProtos.GetUserPermissionsRequest.newBuilder();
    if (namespace != null) {
      builder.setNamespaceName(UnsafeByteOperations.unsafeWrap(namespace));
    }
    if (!StringUtils.isEmpty(userName)) {
      builder.setUserName(ByteString.copyFromUtf8(userName));
    }
    builder.setType(AccessControlProtos.Permission.Type.Namespace);
    AccessControlProtos.GetUserPermissionsRequest request = builder.build();
    AccessControlProtos.GetUserPermissionsResponse response =
      protocol.getUserPermissions(controller, request);
    List<UserPermission> perms = new ArrayList<>(response.getUserPermissionCount());
    for (AccessControlProtos.UserPermission perm : response.getUserPermissionList()) {
      perms.add(toUserPermission(perm));
    }
    return perms;
  }
A utility used to get permissions for selected namespace based on the specified user name.
@param controller RpcController
@param protocol   the AccessControlService protocol proxy
@param namespace  name of the namespace
@param userName   User name, if empty then all user permissions will be retrieved.
@deprecated Use {@link Admin#getUserPermissions(GetUserPermissionsRequest)} instead.
hbase-client/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlUtil.java