diff --git a/server/commons/Handler.coffee b/server/commons/Handler.coffee index 23909b6a2..b486b79b0 100644 --- a/server/commons/Handler.coffee +++ b/server/commons/Handler.coffee @@ -21,7 +21,7 @@ module.exports = class Handler hasAccessToDocument: (req, document, method=null) -> return true if req.user?.isAdmin() if @modelClass.schema.uses_coco_permissions - return document.hasPermissionsForMethod(req.user, method or req.method) + return document.hasPermissionsForMethod?(req.user, method or req.method) return true formatEntity: (req, document) -> document?.toObject()