It looks like users are able to delete their own activity, with no option to turn this feature off..
Is this intentional, or is there a way to not allow users to delete their own activity ?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | activity.module.360822.d5.patch | 2.34 KB | jaydub |
| #4 | activity.module.360822.d6.patch | 2.05 KB | jaydub |
Comments
Comment #1
MrGeek commented*Update:
Ok, they can't actually delete their Activity entries - the red X displays for their items, but if they click it they get 'access denied'..
probably better to suppress the red-X if possible ?
Comment #2
alphageekboy commentedThis error also appears in Version 6.x-1.x-dev.
The problem is that module is looking too see if the user has "Administer Activity" permissions. There needs to be a new permission added to the activity module that allows the admin to set "Administer Own Activity" permissions. Giving the user generic Administer Activity permissions allows the user to delete any activity not just there own.
My quick solution is to add the following to my template.php file to not show the Red X for deleting the activity. This prevents anyone from hovering over a single activity entry and deleting.*
*light is the name of theme.
Comment #3
jaydub commentedam adding a permission for 'delete activity'. This combined with some other changes should address this issue. Will check back later after I've committed the changed. Basically the delete link will only be shown if the user has administer activity permission OR if they have delete activity permission AND are the user (uid) of the activity record.
The activity delete link (which could be accessed by going straight to an activity delete URL) also has a second check for permission to delete the activity.
Comment #4
jaydub commentedI've attached patches for d5 and d6 versions. If anyone can help me test I would appreciate it.
Comment #5
Apollo610 commentedHey jay, I applied the patch to my dev site and tested out a bunch of scenarios, and everything seems to be working perfectly (I gave Delete Activity permissions to authenticated users).
They're able to delete only activity that originated with them (and the deletionX shows only mousing over these items).
I'll report back if there are any issues that I come across, but so far so good.
Thanks -
Comment #6
jaydub commentedtagging
Comment #7
sirkitree commentedComment #8
sirkitree commentedThese both look good, but I'm curious as to why you didn't take the same approach in the d5 version of the patch? You could do your logic around the menu item to make sure that
is_numeric(arg(2))and then use the'access' => activity_delete_access(arg(2)),Comment #9
jaydub commentedI'd have to check again but I ran into problems that I figured were associated with menu caching of access.
Comment #10
sirkitree commentedcommitted to dev.
Comment #12
minesota commentedSo is this feature available for Drupal 5x ?