diff --git a/examples/ServiceAccountMaintenance/Program.cs b/examples/ServiceAccountMaintenance/Program.cs index b1db970..764ab88 100755 --- a/examples/ServiceAccountMaintenance/Program.cs +++ b/examples/ServiceAccountMaintenance/Program.cs @@ -111,7 +111,7 @@ private static void Main(string[] args) private static void Setup() { ServiceAccountIds = new List(); - var perm = new Permission + var permProject = new Permission { Parts = {new RepeatedField {"prj", ProjectName, "*"}}, Verbs = @@ -123,6 +123,18 @@ private static void Setup() } } }; + + var permServices = new Permission + { + Parts = {new RepeatedField {"srv", "*"}}, + Verbs = + { + new RepeatedField + { + Permission.Types.Verb.Read + } + } + }; Console.WriteLine("Setting up for the scenario by creating new service accounts..."); for (var i = 0; i < NumberOfServiceAccountsToCreate; i++) @@ -131,7 +143,7 @@ private static void Setup() { Name = ServiceAccountName, ProjectName = ProjectName, - Permissions = {new RepeatedField {perm}}, + Permissions = {new RepeatedField {permProject, permServices}}, Lifetime = Duration.FromTimeSpan(new TimeSpan(1, 0, 0, 0)) // Let this service account live for one day }); ServiceAccountIds.Add(resp.Id);