If you are using the versioning feature, you can get the resource policy associated with the specific Lambda function version or alias by specifying the version or alias name using the Qualifier
parameter. For more information about versioning, see AWS Lambda Function Versioning and Aliases.
For information about adding permissions, see AddPermission.
You need permission for the lambda:GetPolicy action.