To change permissions for all/some patient records, including the template used for future patients, open /bin/edit/Sandbox/ChangePermissions
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 visibility, at line 2 replace
private
with the desired value (hidden
,private
,matchable
,public
,open
) - the target owner, at line 4 replace
groupname
with the desired group name, or uncomment line 6 and replaceusername
with the desired username - the target collaborator, at line 8 replace
groupname
with the desired group name, or uncomment line 10 and replaceusername
with the desired username - the target access level, at line 11 replace
edit
with the desired value (view
,edit
,manage
) - you can add more collaborators, just define new
$collaboratorX
and$accessLevelX
variables and make additionaladdCollaborator
calls - skip the patient template by replacing the query at line 13 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 13 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 13 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 13 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'])