Created
March 14, 2012 13:50
-
-
Save AutomatedTester/2036614 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/dashboard.js b/dashboard.js | |
index 3d2b04c..5c07701 100644 | |
--- a/dashboard.js | |
+++ b/dashboard.js | |
@@ -11,6 +11,23 @@ ddoc = { | |
] | |
}; | |
+ddoc.validate_doc_update = function(newDoc, oldDoc, userCtx){ | |
+ if (newDoc._deleted === true && userCtx.roles.indexOf('_admin') !== -1) ) { | |
+ throw ({ forbidden : "Only an admin is allowed to delete data"}); | |
+ } | |
+ | |
+ var require = function(field) { | |
+ if (!newDoc[field]) throw ({ forbidden : "This document requires the field " + field }); | |
+ } | |
+ | |
+ require("time_start"); | |
+ require("time_end"); | |
+ require("system_info"); | |
+ require("time_end"); | |
+ require("tests_passed"); | |
+ require("tests_failed"); | |
+ require("tests_skipped"); | |
+} | |
var functionalReportsMap = function(doc) { | |
const REPORT_TYPES = [ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment