From d0a2ab5b1e64ad0c9c8960f0ec65262041906ea1 Mon Sep 17 00:00:00 2001 From: Jeremy Guillette Date: Fri, 12 Nov 2021 11:22:14 -0500 Subject: [PATCH] add permission for exhibit files cover image There's apparently a separate permission for exhibit builder files, so I've added that permission when exhibit builder is present, so that students can modify exhibit cover images. --- CourseToolsPlugin.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CourseToolsPlugin.php b/CourseToolsPlugin.php index 88e362b..0aa95fc 100644 --- a/CourseToolsPlugin.php +++ b/CourseToolsPlugin.php @@ -48,9 +48,13 @@ public function hookDefineAcl($args) # Allow students to edit own files, autocomplete tags, access additional elements. # These permissions don't fit into the defined permissions, but are needed. - $acl->allow('student','Files','editSelf'); - $acl->allow('student','Tags',array('autocomplete')); + $acl->allow('student', 'Files', 'editSelf'); + $acl->allow('student', 'Tags', array('autocomplete')); $acl->allow('student', 'Elements', 'element-form'); + # Allow students access to cover images if Exhibit Builder is installed + if ($acl->has('ExhibitBuilder_Files')) { + $acl->allow('student', 'ExhibitBuilder_Files', 'cover-image'); + } # Set student permissions on Simple Pages if ($acl->has('SimplePages_Index') && $acl->has('SimplePages_Page')) {