Skip to content

Commit 1432493

Browse files
committed
Add UserRoleDetail
and return it from getRolesForUser()
1 parent a2db1db commit 1432493

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

core/src/main/java/com/scalar/db/api/AuthAdmin.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ default List<RoleDetail> getRoles() throws ExecutionException {
214214
* @return a list of {@link RoleDetail}s for the given user
215215
* @throws ExecutionException if the operation fails
216216
*/
217-
default List<RoleDetail> getRolesForUser(String username) throws ExecutionException {
217+
default List<UserRoleDetail> getRolesForUser(String username) throws ExecutionException {
218218
throw new UnsupportedOperationException(CoreError.AUTH_NOT_ENABLED.buildMessage());
219219
}
220220

@@ -412,6 +412,10 @@ interface RoleDetail {
412412
List<RoleHierarchy> getRoleHierarchies();
413413
}
414414

415+
interface UserRoleDetail extends RoleDetail {
416+
boolean hasAdminOptionOnUser();
417+
}
418+
415419
/** Represents a user-role assignment */
416420
interface UserRole {
417421
String getUsername();

core/src/main/java/com/scalar/db/common/DecoratedDistributedTransactionAdmin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ public List<RoleDetail> getRoles() throws ExecutionException {
399399
}
400400

401401
@Override
402-
public List<RoleDetail> getRolesForUser(String username) throws ExecutionException {
402+
public List<UserRoleDetail> getRolesForUser(String username) throws ExecutionException {
403403
return distributedTransactionAdmin.getRolesForUser(username);
404404
}
405405

0 commit comments

Comments
 (0)