-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into dev
- Loading branch information
Showing
5 changed files
with
150 additions
and
26 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
//Add hub permission | ||
|
||
var userPermission = {}; | ||
userPermission.accessLevel = 'admin'; | ||
userPermission.entityId = "80b7a1c2-667c-422b-9bd0-e445ee2d9ac8"; //hubId | ||
userPermission.userId = '133855'; | ||
userPermission.entityType = 'au.org.ala.ecodata.Hub'; | ||
userPermission.status = "active"; | ||
db.userPermission.insert(userPermission); | ||
|
||
//Add project permissions | ||
|
||
var programs = db.hub.findOne({hubId:"80b7a1c2-667c-422b-9bd0-e445ee2d9ac8"}).supportedPrograms; | ||
|
||
for (i =0;i<programs.length;i++) { | ||
let program = programs[i]; | ||
var projects = db.project.find({associatedProgram: program, status:"active"},{projectId:1, _id:0}); | ||
while (projects.hasNext()) { | ||
|
||
let project = projects.next(); | ||
print(project.projectId) | ||
|
||
var userPermission = {}; | ||
userPermission.accessLevel = 'admin'; | ||
userPermission.entityId = project.projectId; | ||
userPermission.userId = '133855'; | ||
userPermission.entityType = 'au.org.ala.ecodata.Project'; | ||
userPermission.status = "active"; | ||
db.userPermission.insert(userPermission); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//This script can be used to update the record owners (recorded by) of the uploaded records in biocollect | ||
|
||
var activityList = db.activity.find({projectActivityId:"", status:"active"}) | ||
|
||
while (activityList.hasNext()) { | ||
var activity = activityList.next(); | ||
|
||
if(activity.userId != ""){ | ||
activity.userId = "" | ||
} | ||
|
||
db.activity.save(activity) | ||
} | ||
|
||
var recordList = db.record.find({projectActivityId:"", status:"active"}) | ||
|
||
while (recordList.hasNext()) { | ||
var record = recordList.next(); | ||
|
||
if(record.userId != ""){ | ||
record.userId = "" | ||
} | ||
|
||
db.record.save(record) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// This script provides functionality to update the new field projLifecycleStatus in all existing active biocollect | ||
// projects to Published | ||
|
||
print("Start to update projLifecycleStatus"); | ||
|
||
db.project.update( | ||
|
||
{ status: 'active', isMERIT: false }, | ||
{ $set: { projLifecycleStatus: true } }, | ||
{ upsert: false, multi: true } | ||
|
||
) | ||
|
||
print("Completed!"); |
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
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