@Override public void read(org.apache.thrift.protocol.TProtocol prot, list_sentry_privileges_by_authorizable_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.request = new TListSentryPrivilegesByAuthRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } } }
public Object getFieldValue(_Fields field) { switch (field) { case PROTOCOL_VERSION: return getProtocol_version(); case REQUESTOR_USER_NAME: return getRequestorUserName(); case COMPONENT: return getComponent(); case SERVICE_NAME: return getServiceName(); case AUTHORIZABLES_SET: return getAuthorizablesSet(); case GROUPS: return getGroups(); case ROLE_SET: return getRoleSet(); } throw new IllegalStateException(); }
case PROTOCOL_VERSION: if (value == null) { unsetProtocol_version(); } else { setProtocol_version((Integer)value); unsetRequestorUserName(); } else { setRequestorUserName((String)value); unsetComponent(); } else { setComponent((String)value); unsetServiceName(); } else { setServiceName((String)value); unsetAuthorizablesSet(); } else { setAuthorizablesSet((Set<String>)value); unsetGroups(); } else { setGroups((Set<String>)value); unsetRoleSet(); } else { setRoleSet((TSentryActiveRoleSet)value);
Set<String> groups, ActiveRoleSet roleSet) throws SentryUserException { TListSentryPrivilegesByAuthRequest request = new TListSentryPrivilegesByAuthRequest(); request.setProtocol_version(sentry_common_serviceConstants.TSENTRY_SERVICE_V2); request.setComponent(component); request.setServiceName(serviceName); request.setRequestorUserName(requestorUserName); request.setAuthorizablesSet(authorizablesSet); request.setGroups(new HashSet<String>()); } else { request.setGroups(groups); request.setRoleSet(new TSentryActiveRoleSet(roleSet.isAll(), roleSet.getRoles()));
TListSentryPrivilegesByAuthRequest request4 = new TListSentryPrivilegesByAuthRequest(); request4.setGroups(Sets.newHashSet(groupName)); request4.setRoleSet(new TSentryActiveRoleSet(true, null)); request4.setRequestorUserName(ADMIN_USER); Set<String> authorizablesSet = Sets.newHashSet("Collection=c1->Field=f1"); request4.setAuthorizablesSet(authorizablesSet); TListSentryPrivilegesByAuthRequest request5 = new TListSentryPrivilegesByAuthRequest(); request5.setRequestorUserName("not_" + ADMIN_USER); authorizablesSet = Sets.newHashSet("Collection=c1->Field=f2"); request5.setAuthorizablesSet(authorizablesSet);
public TListSentryPrivilegesByAuthRequest deepCopy() { return new TListSentryPrivilegesByAuthRequest(this); }
/** * Performs a deep copy on <i>other</i>. */ public list_sentry_privileges_by_authorizable_args(list_sentry_privileges_by_authorizable_args other) { if (other.isSetRequest()) { this.request = new TListSentryPrivilegesByAuthRequest(other.request); } }
Set<String> requestedGroups = request.getGroups(); String subject = request.getRequestorUserName(); TSentryActiveRoleSet activeRoleSet = request.getRoleSet(); Set<String> validActiveRoles = Sets.newHashSet(); validateClientVersion(request.getProtocol_version()); Set<String> memberGroups = getRequestorGroups(conf, subject); Set<String> grantedRoles = toTrimmedLower(store.getRolesByGroups(request.getComponent(), requestedGroups)); requestedRoles = toTrimmedLower(store.getRolesByGroups(request.getComponent(), requestedGroups)); if (request.getAuthorizablesSet() != null) { for (String authorizablesStr : request.getAuthorizablesSet()) { Set<MSentryGMPrivilege> sentryPrivileges = store.getPrivilegesByAuthorizable(request.getComponent(), request.getServiceName(), validActiveRoles, authorizables); authRoleMap.put(fromAuthorizableToStr(authorizables), toTSentryPrivilegeMap(sentryPrivileges));
public void read(org.apache.thrift.protocol.TProtocol iprot, list_sentry_privileges_by_authorizable_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // REQUEST if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.request = new TListSentryPrivilegesByAuthRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); struct.validate(); }