def get_permissions(FunctionName, Qualifier=None,
                   region=None, key=None, keyid=None, profile=None):

    try:
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        kwargs = {}
        if Qualifier is not None:
            kwargs['Qualifier'] = Qualifier
        # The get_policy call is not symmetric with add/remove_permissions. So
        # massage it until it is, for better ease of use.
        policy = conn.get_policy(FunctionName=FunctionName,
                                   **kwargs)
        policy = policy.get('Policy', {})
        if isinstance(policy, string_types):
            policy = json.loads(policy)
        if policy is None:
            policy = {}
        permissions = {}
        for statement in policy.get('Statement', []):
            condition = statement.get('Condition', {})
            principal = statement.get('Principal', {})
            if 'AWS' in principal:
                principal = principal['AWS'].split(':')[4]
            else:
                principal = principal.get('Service')
            permission = {
                'Action': statement.get('Action'),
                'Principal': principal,
            }
            if 'ArnLike' in condition:
                permission['SourceArn'] = condition['ArnLike'].get('AWS:SourceArn')
            if 'StringEquals' in condition:
                permission['SourceAccount'] = condition['StringEquals'].get('AWS:SourceAccount')
            permissions[statement.get('Sid')] = permission
        return {'permissions': permissions}
    except ClientError as e:
        err = salt.utils.boto3.get_error(e)
        if e.response.get('Error', {}).get('Code') == 'ResourceNotFoundException':
            return {'permissions': None}
        return {'permissions': None, 'error': err}
Get resource permissions for the given lambda function
dataset/ETHPy150Open saltstack/salt/salt/modules/boto_lambda.py/get_permissions