-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(iam): policy added to resource for immutable Role #5568
Conversation
`addToPolicy()` is supposed to return `true` or `false` indicating whether the policy was added to an identity for the purposes of determining whether it should be added to a resource policy instead. It's an error if a `Grant` can't be added to the identity *and* it can't be added to the resource (because the resource doesn't support resource policies). Immutable roles should return `true` (even though they didn't actually add the statement to any policy), because we assume the user already put the right permissions on the identity, so we pretend the add worked.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Thank you for contributing! Your pull request is now being automatically merged. |
Thank you for contributing! Your pull request is now being automatically merged. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Maybe in v2.0 we should return an enum instead of a boolean, so it will be more readable. |
addToPolicy()
is supposed to returntrue
orfalse
indicatingwhether the policy was added to an identity for the purposes of
determining whether it should be added to a resource policy instead.
It's an error if a
Grant
can't be added to the identity and it can'tbe added to the resource (because the resource doesn't support resource
policies).
Immutable roles should return
true
(even though they didn't actuallyadd the statement to any policy), because we assume the user already
put the right permissions on the identity, so we pretend the add worked.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license