def get_grant_name(grant):
    """Get grant name based on Grantee type."""
    grant_name = ''
    if grant['Grantee']['Type'] == 'Group':
        uri = grant['Grantee']['URI']
        grant_name = uri.rsplit('/', 1)[-1]
    if grant['Grantee']['Type'] == 'CanonicalUser':
        grant_name = grant['Grantee']['DisplayName']
    return grant_name
