Events Made Easy › Forums › How do I … › How can some users delete their own events
Tagged: i
- This topic has 10 replies, 2 voices, and was last updated 4 years, 11 months ago by Franky.
-
AuthorPosts
-
Fri 29 Nov 2019 at 10:09 #60556AnonymousInactive
Hi Francky,
Some users of my site can create events with this plugin. But they can’t delete their events after create it with this plugin.
I give them access to the backend where they can access only to owned event. They can update it but they can’t delete their event.
This option “delete” doesn’t exist in the menu setting/access/events only modify/update
Is it necessary to be administrator to delete an event or is there a solution for those who have created this event ?
Thanks a lot for your work.
Best regardsSat 30 Nov 2019 at 11:21 #60558FrankyKeymasterWhen editing the event, they should be able to press the “delete button” as well if they are the owner of the event.
Sat 30 Nov 2019 at 16:17 #60560AnonymousInactiveI have the last Version 2.1.54.
All access settings are returned by default.
To modify or delete their own events they have to be “publish posts”. However, They have this error “access denied” when they press “delete button” (trash on the right) but it’s ok when they only modify it.
I don’t understandSun 1 Dec 2019 at 00:21 #60562FrankyKeymasterYour user needs the right defined in the EME setings called “Author events”. That right gives the person the right to edit his events and delete them if wanted. I just tried this here, it works as expected. The right to edit and delete your own event is indeed the same.
Tue 3 Dec 2019 at 22:36 #60573AnonymousInactiveI don’t understand where is the bug. On my site a user with “publish_post” right (setting for “author events”) can edit its own events but not delete them. To delete them I need to add “delete other post” to their role. Surprising !
I use only plugins and do not develop with PHP. I use “User Role Editor” for manage user capabilities. And “Menu Editor” for manage Admin menu.
Any idea where I could look for ?Best regards
Tue 3 Dec 2019 at 23:10 #60574FrankyKeymasterAre you sure the event author is the same as the person trying to delete the event?
If you can reproduce it: give me a temp account that has the issue and such an event, so I can take a look. Also give me a second admin account to see all the settings then.Wed 4 Dec 2019 at 08:47 #60576AnonymousInactiveYes.
For the accounts have you a discreet means of communication ?Wed 4 Dec 2019 at 10:15 #60578AnonymousInactiveAs it is publish events, may be you give the capability delete_events but not delete_published_events ?
Wed 4 Dec 2019 at 12:58 #60579FrankyKeymasterOk, my test was wrong and you’ve helped me find the bug 🙂
Replace in eme_events.php lines 205 and 206 from:$ids_arr=array($event_ID); $res=eme_trash_events($ids_arr);
to just:
$res=eme_trash_events($event_ID);
Then it should work. I was distracted by the fact you said people got an “access denied”. I don’t get it on your site (the “access denied”), but I saw that the event was actually never deleted either. On my end I just focused on not getting the “access denied” and just never realized the event wasn’t deleted. So I dug a little deeper and found this bug.
Via the dropdown it is not allowed (since you can’t manage events), but the message that it isn’t allowed is not shown, I’ll correct that too.Wed 4 Dec 2019 at 14:45 #60581AnonymousInactiveHi Franky
After changing the lines, yes ! i can delete the own event after edit it and click on the button “delete event” at the bottom the of the form.
Thanks for the solution.
I understand also know why this doesn’t work via the dropdown. The box window (access denied) that i always have was not explicite enough for me.Wed 4 Dec 2019 at 15:33 #60582FrankyKeymasterWell, I’ll change the dropdown, so that if a user doesn’t have the correct rights, the accompanying options are hidden too.
-
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.