use of com.facebook.presto.spi.security.PrincipalType.ROLE in project presto by prestodb.
the class ThriftMetastoreUtil method listApplicableTablePrivileges.
public static Stream<HivePrivilegeInfo> listApplicableTablePrivileges(SemiTransactionalHiveMetastore metastore, ConnectorIdentity identity, MetastoreContext metastoreContext, String databaseName, String tableName, String user) {
PrestoPrincipal userPrincipal = new PrestoPrincipal(USER, user);
Stream<PrestoPrincipal> principals = Stream.concat(Stream.of(userPrincipal), listApplicableRoles(metastore, identity, userPrincipal, metastoreContext).map(role -> new PrestoPrincipal(ROLE, role)));
return listTablePrivileges(identity, metastoreContext, metastore, databaseName, tableName, principals);
}
Aggregations