mc admin policy attach
Attaches one or more IAM policies to either an AIStor-managed user or a group.
Exactly one --user or one --group is required.
This command is intended for managing policy associations for MinIO-managed users only.
For attaching policies to OpenID-managed users, see OpenID Connect Access Management.
For attaching policies to Active Directory/LDAP users or groups, use mc idp ldap policy attach.
Syntax
Parameters
The mc admin policy attach command accepts the following arguments:
TARGET
Required
The alias of a configured AIStor deployment with the user or group for which you want to attach one or more policies.
POLICY
Required
The name of the policy to attach to either the user or the group.
You may attach multiple policies at once by separating each policy name with a space.
AIStor deployments include the following built-in policies by default:
--user
Optional
The username of the identity you want to attach the policy or policies to. You may only list one user.
You must include either the --user flag or the --group flag.
You may not use the --user flag at the same time as the --group flag.
--group
Optional
The name of the group identity you want to attach the policy or policies to. You may only list one group.
All users with membership in the group inherit the policies associated to the group.
You must include either the --group flag or the --user flag.
You may not use the --group flag at the same time as the --user flag.
Global flags
This command supports any of the global flags.
Examples
Attach the readonly policy to user james on the deployment at alias myaistor.
mc admin policy attach myaistor readonly --user james
Attach the audit-policy and acct-policy policies to group legal on the deployment at alias myaistor.
mc admin policy attach myaistor audit-policy acct-policy --group legal