return PermissionsHelper.grant(doc, permission, user);
}
public static ODocument revokePermissionToUser(String collectionName, String rid, Permissions permission, String username) throws UserNotFoundException, IllegalArgumentException, InvalidCollectionException, InvalidModelException, DocumentNotFoundException {
OUser user=UserService.getOUserByUsername(username);
if (user==null) throw new UserNotFoundException(username);
ODocument doc = get(collectionName, rid);
if (doc==null) throw new DocumentNotFoundException(rid);
return PermissionsHelper.revoke(doc, permission, user);
}