diff --git a/metastore/if/hive_metastore.thrift b/metastore/if/hive_metastore.thrift index 58b2357..f46f528 100755 --- a/metastore/if/hive_metastore.thrift +++ b/metastore/if/hive_metastore.thrift @@ -107,13 +107,18 @@ struct Role { 1: string roleName, 2: i32 createTime, 3: string ownerName, - 4: optional string principalName, - 5: optional string principalType, - 6: optional bool grantOption, - 7: optional i32 grantTime, - 8: optional string grantor } +struct RoleGrant { + 1: string roleName, + 2: string principalName, + 3: string principalType, + 4: bool grantOption, + 5: i32 grantTime, + 6: string grantor +} + + // namespace for tables struct Database { 1: string name, @@ -745,6 +750,13 @@ service ThriftHiveMetastore extends fb303.FacebookService bool create_role(1:Role role) throws(1:MetaException o1) bool drop_role(1:string role_name) throws(1:MetaException o1) + + // get all role-grant descriptors(/mapping) for users/roles that have been granted the given role + list get_role_grants_for_role(1:string role_name) throws(1:MetaException o1) + + // get all role-grant descriptors(/mapping) for the roles granted for this given principal + list get_role_grants_for_principal(1:string principal_name, 2:PrincipalType principal_type) throws(1:MetaException o1) + list get_role_names() throws(1:MetaException o1) bool grant_role(1:string role_name, 2:string principal_name, 3:PrincipalType principal_type, 4:string grantor, 5:PrincipalType grantorType, 6:bool grant_option) throws(1:MetaException o1)