@Override public List<HiveRoleGrant> getRoleGrantInfoForPrincipal(HivePrincipal principal) throws HiveAuthzPluginException, HiveAccessControlException { try { // first authorize the call if (!isUserAdmin()) { ensureShowGrantAllowed(principal); } List<RolePrincipalGrant> roleGrants = getRoleGrants(principal.getName(), AuthorizationUtils.getThriftPrincipalType(principal.getType())); List<HiveRoleGrant> hiveRoleGrants = new ArrayList<HiveRoleGrant>(roleGrants.size()); for (RolePrincipalGrant roleGrant : roleGrants) { hiveRoleGrants.add(new HiveRoleGrant(roleGrant)); } return hiveRoleGrants; } catch (Exception e) { throw SQLAuthorizationUtils.getPluginException("Error getting role grant information for user " + principal.getName(), e); } }
@Override public List<HiveRoleGrant> getRoleGrantInfoForPrincipal(HivePrincipal principal) throws HiveAuthzPluginException, HiveAccessControlException { try { // first authorize the call if (!isUserAdmin()) { ensureShowGrantAllowed(principal); } List<RolePrincipalGrant> roleGrants = getRoleGrants(principal.getName(), AuthorizationUtils.getThriftPrincipalType(principal.getType())); List<HiveRoleGrant> hiveRoleGrants = new ArrayList<HiveRoleGrant>(roleGrants.size()); for (RolePrincipalGrant roleGrant : roleGrants) { hiveRoleGrants.add(new HiveRoleGrant(roleGrant)); } return hiveRoleGrants; } catch (Exception e) { throw SQLAuthorizationUtils.getPluginException("Error getting role grant information for user " + principal.getName(), e); } }
ensureShowGrantAllowed(principal);
ensureShowGrantAllowed(principal);
@Override public List<HiveRoleGrant> getRoleGrantInfoForPrincipal(HivePrincipal principal) throws HiveAuthzPluginException, HiveAccessControlException { try { // first authorize the call if (!isUserAdmin()) { ensureShowGrantAllowed(principal); } List<RolePrincipalGrant> roleGrants = getRoleGrants(principal.getName(), AuthorizationUtils.getThriftPrincipalType(principal.getType())); List<HiveRoleGrant> hiveRoleGrants = new ArrayList<HiveRoleGrant>(roleGrants.size()); for (RolePrincipalGrant roleGrant : roleGrants) { hiveRoleGrants.add(new HiveRoleGrant(roleGrant)); } return hiveRoleGrants; } catch (Exception e) { throw SQLAuthorizationUtils.getPluginException("Error getting role grant information for user " + principal.getName(), e); } }