< Back

Add-GcsDefaultObjectAcl

Mon Jan 13, 2020 11:03 pm

NAME Add-GcsDefaultObjectAcl



SYNOPSIS

Add a default access control to a Google Cloud Storage bucket.





SYNTAX

Add-GcsDefaultObjectAcl [-Name] <string> -Role <string> -User <string> [<CommonParameters>]



Add-GcsDefaultObjectAcl [-Name] <string> -Role <string> -Group <string> [<CommonParameters>]



Add-GcsDefaultObjectAcl [-Name] <string> -Role <string> -Domain <string> [<CommonParameters>]



Add-GcsDefaultObjectAcl [-Name] <string> -Role <string> -ProjectNumber <string> -ProjectRole <string>

[<CommonParameters>]



Add-GcsDefaultObjectAcl [-Name] <string> -Role <string> [-AllUsers <SwitchParameter>] [<CommonParameters>]



Add-GcsDefaultObjectAcl [-Name] <string> -Role <string> [-AllAuthenticatedUsers <SwitchParameter>]

[<CommonParameters>]





DESCRIPTION

Add a default access control to a Google Cloud Storage bucket for an entity. The default access control will be

aplied to a new object when no access control is provided. 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 bucket.





PARAMETERS

-Name <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



-Bucket <string>

The name of the bucket that the access control will be applied to.



This is an alias of the Name parameter.



Required? true

Position? 0

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-GcsDefaultObjectAcl -Role Reader -Bucket "my-bucket" -User user@example.com



Adds reader default access control to bucket "my-bucket" for user user@example.com.

---------- EXAMPLE 2 ----------



PS C:\\> Add-GcsDefaultObjectAcl -Role Writer -Bucket "my-bucket" -Domain example.com



Adds writer default access control to bucket "my-bucket" for the domain example.com.

---------- EXAMPLE 3 ----------



PS C:\\> Add-GcsDefaultObjectAcl -Role Owner -Bucket "my-bucket" -AllUsers



Adds owner default access control to bucket "my-bucket" for all users.

---------- EXAMPLE 4 ----------



PS C:\\> Add-GcsDefaultObjectAcl -Role Owner -Bucket "my-bucket" -ProjectRole Owners -ProjectNumber 3423432



Adds owner default access control to bucket "my-bucket" for all owners of project 3423432.



RELATED LINKS

[Access Control Lists (ACLs)] (https://cloud.google.com/storage/docs/a ... trol/lists)

[Default Access Controls] (https://cloud.google.com/storage/docs/j ... ssControls)