예제 #1
0
    def Run(self, args):
        messages = cloudkms_base.GetMessagesModule()

        policy = iam_util.ParseJsonPolicyFile(args.policy_file,
                                              messages.Policy)

        return iam.SetKeyRingIamPolicy(flags.ParseKeyRingName(args), policy)
예제 #2
0
    def Run(self, args):
        messages = cloudkms_base.GetMessagesModule()

        policy, update_mask = iam_util.ParseYamlOrJsonPolicyFile(
            args.policy_file, messages.Policy)

        keyring_ref = flags.ParseKeyRingName(args)
        result = iam.SetKeyRingIamPolicy(keyring_ref, policy, update_mask)
        iam_util.LogSetIamPolicy(keyring_ref.Name(), 'keyring')
        return result