To add a new collaborator for all patient records, including the template used for future patients, open /bin/edit/Sandbox/AddCollaborator
in a browser while logged in with an administrative account, paste the following snippet, and press Preview
.
WARNING: Pressing Preview
doesn't preview the changes, it will actually modify the permissions!
Things you can adjust:
- the target access level, at line 2 replace
edit
with the desired value (view
,edit
,manage
) - the target collaborator, at line 3 replace
groupname
with the desired group name, or uncomment line 5 and replaceusername
with the desired username - skip the patient template by replacing the query at line 6 with
'from doc.object(PhenoTips.PatientClass) as p where doc.name <> ''PatientTemplate'''
- only include records of a certain user by replacing the query at line 6 with
'from doc.object(PhenoTips.PatientClass) as p, doc.object(PhenoTips.OwnerClass) as o where o.owner = ''xwiki:XWiki.username'''
- only include records of a certain workgroup by replacing the query at line 6 with
'from doc.object(PhenoTips.PatientClass) as p, doc.object(PhenoTips.OwnerClass) as o where o.owner = ''xwiki:Groups.groupname'''
- only include records with an external ID matching a specific substring by replacing the query at line 6 with
'from doc.object(PhenoTips.PatientClass) as p where p.external_id like ''GC%'''
- modify a specific set of patient records by specifying it manually:
#foreach ($i in ['P0000001', 'P0000005', 'P0000042'])