< Back
Add-GcsObjectAcl
Post
NAME Add-GcsObjectAcl
SYNOPSIS
Add an access control to a Google Cloud Storage object.
SYNTAX
Add-GcsObjectAcl [-Bucket] <string> [-ObjectName] <string> -Role <string> -User <string> [<CommonParameters>]
Add-GcsObjectAcl [-Bucket] <string> [-ObjectName] <string> -Role <string> -Group <string> [<CommonParameters>]
Add-GcsObjectAcl [-Bucket] <string> [-ObjectName] <string> -Role <string> -Domain <string> [<CommonParameters>]
Add-GcsObjectAcl [-Bucket] <string> [-ObjectName] <string> -Role <string> -ProjectNumber <string> -ProjectRole
<string> [<CommonParameters>]
Add-GcsObjectAcl [-Bucket] <string> [-ObjectName] <string> -Role <string> [-AllUsers <SwitchParameter>]
[<CommonParameters>]
Add-GcsObjectAcl [-Bucket] <string> [-ObjectName] <string> -Role <string> [-AllAuthenticatedUsers
<SwitchParameter>] [<CommonParameters>]
DESCRIPTION
Add an access control to a Google Cloud Storage object for an entity. Entity can be user ID, user email address,
project team, group ID, group email address, all users or all authenticated users. The roles that can be assigned
to an entity are Reader, Writer and Owner. User must have access to the object.
PARAMETERS
-Bucket <string>
The name of the bucket that the access control will be applied to.
Required? true
Position? 0
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ObjectName <string>
The name of the object that the access control will be applied to.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Role <string>
The role of the access control.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-User <string>
The user holding the access control. This can either be an email or a user ID.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-UserId <string>
The user holding the access control. This can either be an email or a user ID.
This is an alias of the User parameter.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-UserEmail <string>
The user holding the access control. This can either be an email or a user ID.
This is an alias of the User parameter.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Group <string>
The group holding the access control. This can either be an email or an ID.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-GroupId <string>
The group holding the access control. This can either be an email or an ID.
This is an alias of the Group parameter.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-GroupEmail <string>
The group holding the access control. This can either be an email or an ID.
This is an alias of the Group parameter.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Domain <string>
The domain holding the access control.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ProjectNumber <string>
The project number of the project holding the access control. This is used in conjunction with -ProjectRole
parameter to specify a project team.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ProjectRole <string>
The project role (in the project specified by -ProjectNumber) holding the access control.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AllUsers <SwitchParameter>
If set, the access control will be for all user.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-AllAuthenticatedUsers <SwitchParameter>
If set, the access control will be for all authenticated user.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
Google.Apis.Storage.v1.Data.ObjectAccessControl
---------- EXAMPLE 1 ----------
PS C:\\> Add-GcsObjectAcl -Role Reader -Bucket "my-bucket" -ObjectName "my-object" -User user@example.com
Adds reader access control to the object "my-object" in bucket "my-bucket" for user user@example.com.
---------- EXAMPLE 2 ----------
PS C:\\> Add-GcsObjectAcl -Role Writer -Bucket "my-bucket" -ObjectName "my-object" -Domain example.com
Adds writer access control to the object "my-object" in bucket "my-bucket" for the domain example.com.
---------- EXAMPLE 3 ----------
PS C:\\> Add-GcsObjectAcl -Role Owner -Bucket "my-bucket" -ObjectName "my-object" -AllUsers
Adds owner access control to the object "my-object" in bucket "my-bucket" for all users.
---------- EXAMPLE 4 ----------
PS C:\\> Add-GcsObjectAcl -Role Owner -Bucket "my-bucket" -ObjectName "my-object" -ProjectRole Owners
-ProjectNumber 3423432
Adds owner access control to the object "my-object" in bucket "my-bucket" for all owners of project 3423432.
RELATED LINKS
[Access Control Lists (ACLs)] (https://cloud.google.com/storage/docs/a ... trol/lists)
[Object Access Controls] (https://cloud.google.com/storage/docs/j ... ssControls)
SYNOPSIS
Add an access control to a Google Cloud Storage object.
SYNTAX
Add-GcsObjectAcl [-Bucket] <string> [-ObjectName] <string> -Role <string> -User <string> [<CommonParameters>]
Add-GcsObjectAcl [-Bucket] <string> [-ObjectName] <string> -Role <string> -Group <string> [<CommonParameters>]
Add-GcsObjectAcl [-Bucket] <string> [-ObjectName] <string> -Role <string> -Domain <string> [<CommonParameters>]
Add-GcsObjectAcl [-Bucket] <string> [-ObjectName] <string> -Role <string> -ProjectNumber <string> -ProjectRole
<string> [<CommonParameters>]
Add-GcsObjectAcl [-Bucket] <string> [-ObjectName] <string> -Role <string> [-AllUsers <SwitchParameter>]
[<CommonParameters>]
Add-GcsObjectAcl [-Bucket] <string> [-ObjectName] <string> -Role <string> [-AllAuthenticatedUsers
<SwitchParameter>] [<CommonParameters>]
DESCRIPTION
Add an access control to a Google Cloud Storage object for an entity. Entity can be user ID, user email address,
project team, group ID, group email address, all users or all authenticated users. The roles that can be assigned
to an entity are Reader, Writer and Owner. User must have access to the object.
PARAMETERS
-Bucket <string>
The name of the bucket that the access control will be applied to.
Required? true
Position? 0
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ObjectName <string>
The name of the object that the access control will be applied to.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Role <string>
The role of the access control.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-User <string>
The user holding the access control. This can either be an email or a user ID.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-UserId <string>
The user holding the access control. This can either be an email or a user ID.
This is an alias of the User parameter.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-UserEmail <string>
The user holding the access control. This can either be an email or a user ID.
This is an alias of the User parameter.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Group <string>
The group holding the access control. This can either be an email or an ID.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-GroupId <string>
The group holding the access control. This can either be an email or an ID.
This is an alias of the Group parameter.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-GroupEmail <string>
The group holding the access control. This can either be an email or an ID.
This is an alias of the Group parameter.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Domain <string>
The domain holding the access control.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ProjectNumber <string>
The project number of the project holding the access control. This is used in conjunction with -ProjectRole
parameter to specify a project team.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ProjectRole <string>
The project role (in the project specified by -ProjectNumber) holding the access control.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AllUsers <SwitchParameter>
If set, the access control will be for all user.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-AllAuthenticatedUsers <SwitchParameter>
If set, the access control will be for all authenticated user.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
Google.Apis.Storage.v1.Data.ObjectAccessControl
---------- EXAMPLE 1 ----------
PS C:\\> Add-GcsObjectAcl -Role Reader -Bucket "my-bucket" -ObjectName "my-object" -User user@example.com
Adds reader access control to the object "my-object" in bucket "my-bucket" for user user@example.com.
---------- EXAMPLE 2 ----------
PS C:\\> Add-GcsObjectAcl -Role Writer -Bucket "my-bucket" -ObjectName "my-object" -Domain example.com
Adds writer access control to the object "my-object" in bucket "my-bucket" for the domain example.com.
---------- EXAMPLE 3 ----------
PS C:\\> Add-GcsObjectAcl -Role Owner -Bucket "my-bucket" -ObjectName "my-object" -AllUsers
Adds owner access control to the object "my-object" in bucket "my-bucket" for all users.
---------- EXAMPLE 4 ----------
PS C:\\> Add-GcsObjectAcl -Role Owner -Bucket "my-bucket" -ObjectName "my-object" -ProjectRole Owners
-ProjectNumber 3423432
Adds owner access control to the object "my-object" in bucket "my-bucket" for all owners of project 3423432.
RELATED LINKS
[Access Control Lists (ACLs)] (https://cloud.google.com/storage/docs/a ... trol/lists)
[Object Access Controls] (https://cloud.google.com/storage/docs/j ... ssControls)