From c840f368f4007afba526b149c3719a282583cbb5 Mon Sep 17 00:00:00 2001 From: Andrea Longo Date: Mon, 12 Jun 2023 13:34:57 -0600 Subject: [PATCH] mc admin user info: view inherited policies from groups (#878) Remaining item from https://github.com/minio/docs/issues/866: `mc admin user info --JSON` includes the policies the user inherited from their group membership in the `memberOf` property. Staged: http://192.241.195.202:9000/staging/DOCS-866-mc-admin-user-info/linux/html/reference/minio-mc-admin/mc-admin-user-info.html Fixes https://github.com/minio/docs/issues/866 --------- Co-authored-by: Daryl White <53910321+djwfyi@users.noreply.github.com> --- .../minio-mc-admin/mc-admin-user-info.rst | 41 +++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/source/reference/minio-mc-admin/mc-admin-user-info.rst b/source/reference/minio-mc-admin/mc-admin-user-info.rst index 252f8011..2bd18f47 100644 --- a/source/reference/minio-mc-admin/mc-admin-user-info.rst +++ b/source/reference/minio-mc-admin/mc-admin-user-info.rst @@ -12,7 +12,6 @@ .. mc:: mc admin user info - Syntax ------ @@ -71,9 +70,12 @@ Global Flags :start-after: start-minio-mc-globals :end-before: end-minio-mc-globals +.. versionchanged:: RELEASE.2023-05-26T23-31-54Z -Example -------- + ``mc admin user info --JSON`` output includes policies inherited from a user's group memberships in ``memberOf``. + +Examples +-------- View User Details ~~~~~~~~~~~~~~~~~ @@ -98,6 +100,39 @@ The output resembles the following: PolicyName: readwrite MemberOf: +View Policies from Group Membership +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Use :mc-cmd:`mc admin user info` with :std:option:`--JSON ` to view the policies inherited from a user's :ref:`group memberships `: + +.. code-block:: shell + :class: copyable + + mc admin user info ALIAS USERNAME --JSON + +- Replace :mc-cmd:`ALIAS ` with the :mc-cmd:`alias ` of the MinIO deployment. + +- Replace :mc-cmd:`USERNAME ` with the username of the user to display information for. + +The ``memberOf`` property in the output contains a list of groups the user is a member of, with the policies attached to each group. +The output resembles the following: + +.. code-block:: shell + + { + "status": "success", + "accessKey": "myuser", + "userStatus": "enabled", + "memberOf": [ + { + "name": "testingGroup", + "policies": [ + "testingGroupPolicy" + ] + } + ] + } + Behavior --------