@@ -198,23 +198,23 @@ default void dropRole(String roleName) throws ExecutionException {
198198 }
199199
200200 /**
201- * Retrieves a list of {@link RoleDetail }s.
201+ * Retrieves a list of {@link Role }s.
202202 *
203- * @return a list of {@link RoleDetail }s
203+ * @return a list of {@link Role }s
204204 * @throws ExecutionException if the operation fails
205205 */
206- default List <RoleDetail > getRoles () throws ExecutionException {
206+ default List <Role > getRoles () throws ExecutionException {
207207 throw new UnsupportedOperationException (CoreError .AUTH_NOT_ENABLED .buildMessage ());
208208 }
209209
210210 /**
211- * Retrieves a list of {@link UserRoleDetail }s for the given user.
211+ * Retrieves a list of {@link RoleForUser }s for the given user.
212212 *
213213 * @param username the username
214- * @return a list of {@link UserRoleDetail }s for the given user
214+ * @return a list of {@link RoleForUser }s for the given user
215215 * @throws ExecutionException if the operation fails
216216 */
217- default List <UserRoleDetail > getRolesForUser (String username ) throws ExecutionException {
217+ default List <RoleForUser > getRolesForUser (String username ) throws ExecutionException {
218218 throw new UnsupportedOperationException (CoreError .AUTH_NOT_ENABLED .buildMessage ());
219219 }
220220
@@ -258,13 +258,13 @@ default void revokeAdminOptionFromUser(String username, String roleName)
258258 }
259259
260260 /**
261- * Retrieves a list of {@link UserRole }s for the given role.
261+ * Retrieves a list of {@link GranteeUserRef }s for the given role.
262262 *
263263 * @param roleName the role name
264- * @return a list of {@link UserRole }s for the given role
264+ * @return a list of {@link GranteeUserRef }s for the given role
265265 * @throws ExecutionException if the operation fails
266266 */
267- default List <UserRole > getUsersForRole (String roleName ) throws ExecutionException {
267+ default List <GranteeUserRef > getGranteeUsersForRole (String roleName ) throws ExecutionException {
268268 throw new UnsupportedOperationException (CoreError .AUTH_NOT_ENABLED .buildMessage ());
269269 }
270270
@@ -399,53 +399,83 @@ default void revokePrivilegeFromRole(
399399
400400 /** Represents a user. */
401401 interface User {
402+ /**
403+ * Returns the username.
404+ *
405+ * @return the username
406+ */
402407 String getName ();
403408
409+ /**
410+ * Returns whether the user is a superuser.
411+ *
412+ * @return whether the user is a superuser
413+ */
404414 boolean isSuperuser ();
405415 }
406416
407- /** Represents a role. */
417+ /** Represents a role, including its granted roles . */
408418 interface Role {
419+ /**
420+ * Returns the role name.
421+ *
422+ * @return the role name
423+ */
409424 String getName ();
410- }
411-
412- /** Represents a role with its hierarchy information. */
413- interface RoleDetail {
414- Role getRole ();
415425
416- List <RoleHierarchy > getRoleHierarchies ();
426+ /**
427+ * Returns the roles granted to the role.
428+ *
429+ * @return the roles granted to the role
430+ */
431+ List <GrantedRoleRef > getGrantedRoles ();
417432 }
418433
419434 /**
420- * Represents a role detail for a specific user, including whether the user has admin option for
435+ * Represents a role granted to a specific user, including whether the user has admin option for
421436 * this role.
422437 */
423- interface UserRoleDetail extends RoleDetail {
438+ interface RoleForUser extends Role {
424439 /**
425440 * Returns whether the user has admin option for this role. This is distinct from the admin
426441 * option in role hierarchies, which applies to role-to-role grants.
442+ *
443+ * @return whether the user has admin option for this role
427444 */
428445 boolean hasAdminOptionOnUser ();
429446 }
430447
431- /** Represents a user-role assignment. */
432- interface UserRole {
433- String getUsername ();
434-
435- String getRoleName ();
448+ /** A reference to a grantee user of a role. */
449+ interface GranteeUserRef {
450+ /**
451+ * Returns the username.
452+ *
453+ * @return the username
454+ */
455+ String getName ();
436456
457+ /**
458+ * Returns whether admin option is granted for this assignment.
459+ *
460+ * @return whether admin option is granted for this assignment
461+ */
437462 boolean hasAdminOption ();
438463 }
439464
440- /** Represents a role hierarchy (role-to-role assignment). */
441- interface RoleHierarchy {
442- /** Returns the role name. */
443- String getRoleName ();
444-
445- /** Returns the member role name granted to the role. */
446- String getMemberRoleName ();
465+ /** A reference to a granted role. */
466+ interface GrantedRoleRef {
467+ /**
468+ * Returns the granted role name.
469+ *
470+ * @return the granted role name
471+ */
472+ String getName ();
447473
448- /** Returns whether admin option is granted for this hierarchy. */
474+ /**
475+ * Returns whether admin option is granted for this role grant.
476+ *
477+ * @return whether admin option is granted for this role grant
478+ */
449479 boolean hasAdminOption ();
450480 }
451481
0 commit comments