@Override public List<String> getCurrentRoleNames() throws HiveAuthzPluginException { List<String> roleNames = new ArrayList<String>(); for(HiveRoleGrant role : getCurrentRoles()){ roleNames.add(role.getRoleName()); } return roleNames; }
/** * @return true only if current role of user is Admin * @throws HiveAuthzPluginException */ boolean isUserAdmin() throws HiveAuthzPluginException { List<HiveRoleGrant> roles; roles = getCurrentRoles(); for (HiveRoleGrant role : roles) { if (role.getRoleName().equalsIgnoreCase(HiveMetaStore.ADMIN)) { return true; } } return false; }
@Override public List<String> getCurrentRoleNames() throws HiveAuthzPluginException { List<String> roleNames = new ArrayList<String>(); for(HiveRoleGrant role : getCurrentRoles()){ roleNames.add(role.getRoleName()); } return roleNames; }
/** * @return true only if current role of user is Admin * @throws HiveAuthzPluginException */ boolean isUserAdmin() throws HiveAuthzPluginException { List<HiveRoleGrant> roles; roles = getCurrentRoles(); for (HiveRoleGrant role : roles) { if (role.getRoleName().equalsIgnoreCase(HiveMetaStore.ADMIN)) { return true; } } return false; }
private boolean doesUserHasAdminOption(List<String> roleNames) throws HiveAuthzPluginException { List<HiveRoleGrant> currentRoles; currentRoles = getCurrentRoles(); for (String roleName : roleNames) { boolean roleFound = false; for (HiveRoleGrant currentRole : currentRoles) { if (roleName.equalsIgnoreCase(currentRole.getRoleName())) { roleFound = true; if (!currentRole.isGrantOption()) { return false; } else { break; } } } if (!roleFound) { return false; } } return true; }
private boolean doesUserHasAdminOption(List<String> roleNames) throws HiveAuthzPluginException { List<HiveRoleGrant> currentRoles; currentRoles = getCurrentRoles(); for (String roleName : roleNames) { boolean roleFound = false; for (HiveRoleGrant currentRole : currentRoles) { if (roleName.equalsIgnoreCase(currentRole.getRoleName())) { roleFound = true; if (!currentRole.isGrantOption()) { return false; } else { break; } } } if (!roleFound) { return false; } } return true; }
@Override public List<String> getCurrentRoleNames() throws HiveAuthzPluginException { List<String> roleNames = new ArrayList<String>(); for(HiveRoleGrant role : getCurrentRoles()){ roleNames.add(role.getRoleName()); } return roleNames; }
/** * @return true only if current role of user is Admin * @throws HiveAuthzPluginException */ boolean isUserAdmin() throws HiveAuthzPluginException { List<HiveRoleGrant> roles; roles = getCurrentRoles(); for (HiveRoleGrant role : roles) { if (role.getRoleName().equalsIgnoreCase(HiveMetaStore.ADMIN)) { return true; } } return false; }
private boolean doesUserHasAdminOption(List<String> roleNames) throws HiveAuthzPluginException { List<HiveRoleGrant> currentRoles; currentRoles = getCurrentRoles(); for (String roleName : roleNames) { boolean roleFound = false; for (HiveRoleGrant currentRole : currentRoles) { if (roleName.equalsIgnoreCase(currentRole.getRoleName())) { roleFound = true; if (!currentRole.isGrantOption()) { return false; } else { break; } } } if (!roleFound) { return false; } } return true; }