'Returns the permissions for a given document as a dictionary'

def _massage_permissions(self):

    permissions = {'read': {'users': [], 'groups': []}, 'write': {'users': [], 'groups': []}}
    read_perms = self.get_permission(perm='read')
    write_perms = self.get_permission(perm='write')
    if read_perms:
        permissions.update(read_perms.to_dict())
    if write_perms:
        permissions.update(write_perms.to_dict())
    return permissions
