7938 Posts in 1466 Topics by 943 members
|Go to End|
4 May 2010 at 1:29am
Is it possible in the image gallery module to allow non administrators the ability to delete the images in the Photos tab? The icon doesn't appear for them when you roll over an image.
Thanks in advance,
4 May 2010 at 4:04am
Well, that's cute. Looks like 2.4 sets all the canXXX() functions to default to ADMIN perms in DataObject.php. Not sure how to handle this one. Maybe have a static class property in ImageGalleryItem for $delete_permission, $edit_permission, etc.?
4 May 2010 at 7:11am
Ha, that is cute! I don't want to hack the core of the module. I wonder if there is a simple way to override that default behavior?
4 May 2010 at 7:38am
Using the latest rev, you should be able to add something like:
ImageGalleryItem::$delete_permission = "CMS_ACCESS_CMSMain";
to your _config.php.
4 May 2010 at 8:07am
I just made this change, it works perfect, thanks!
4 June 2010 at 10:49pm
Could you change the default value of this property in ImageGalleryItem.php to this more "liberal" value?
I.e. public static $delete_permission = 'CMS_ACCESS_CMSMain';
I think there are a lot of users who will stumble upon this. It is very strange to set this to ADMIN since it is only a "cosmetic" property - it just hides the delete link (trashcan icon). If you know the ID of the item you still can delete it using the direct link http://yoursite/admin/EditForm/field/GalleryItems/item/ITEM_ID/delete
5 June 2010 at 2:18am
That was a really weird quirk in 2.4. By default, you couldn't delete ImageGalleryItems, so I had to add a canDelete() function to them. I wasn't happy with that addition either, but don't you think CMSMain is an appropriate level of permissions for deleting from the image gallery?
5 June 2010 at 3:27am Last edited: 5 June 2010 3:31am
In my opinion the apropriate permission would be the one needed to delete the file and the Database Entry (i.e. the ImageGalleryItem). With CMS_ACCESS_CMSMain you are able to do this.
In the version currently in the SVN ADMIN is needed, which in my opinion is to high.
|Go to Top|