ElkArte Community

Elk Development => Feature Discussion => Topic started by: kode54 on January 22, 2022, 02:57:54 am

Title: Features or permissions required to delete your own post attachments
Post by: kode54 on January 22, 2022, 02:57:54 am
What permission is required to allow users to delete attachments from their own posts, when they have the permission to edit their own posts?
Title: Re: Features or permissions required to delete your own post attachments
Post by: Steeley on January 22, 2022, 04:30:39 am
I would think a user in a group that has permission to delete and modify their own posts can delete the attachments in their own posts.. (Maybe delete own post permission isn't necessary?)

Admin --> Members --> General Permissions --> Posts --> Delete Own Posts --> Allowed
Admin --> Members --> General Permissions --> Posts --> Modify Own Posts --> Allowed
Admin --> Members --> General Permissions --> Attachments --> View Attachments --> Allowed
Admin --> Members --> General Permissions --> Attachments --> Post Attachments --> Allowed

If not v1.1.6, ymmv...(your mileage may vary)
Title: Re: Features or permissions required to delete your own post attachments
Post by: Spuds on January 22, 2022, 09:19:51 am
I think the conditions that allow that action are:

Has moderator / admin manage attachments permission ...  PASS

Message is not locked, they have the attach permissions (board and member) and then meets one of the following conditions:
     - Has modify any permission (thats really a local moderator level item)
or
     - Is the owner of the message and within edit_disable_time <-- typical
or
     - Is allowed to edit messages in a thread they started <-- kind of special but would allow removing from other messages.

If there is a problem, please let us know :D
Title: Re: Features or permissions required to delete your own post attachments
Post by: kode54 on January 22, 2022, 06:34:30 pm
Yeah, this needs to be for any user, not just moderator / admin.
Title: Re: Features or permissions required to delete your own post attachments
Post by: Spuds on January 22, 2022, 10:01:52 pm
Then that would be this part:

1) Message is not locked,
2) Member has attach permissions (both for the board and general member permissions)
3) Is the owner of the message and within edit_disable_time
Title: Re: Features or permissions required to delete your own post attachments
Post by: kode54 on January 23, 2022, 12:31:56 am
Ah, then it's not a permission being granted by the modification I'm using that allows specific user groups to dodge the edit_disable_time.
Title: Re: Features or permissions required to delete your own post attachments
Post by: Steeley on January 23, 2022, 02:25:35 am
Quote from: kode54 – Ah, then it's not a permission being granted by the modification I'm using that allows specific user groups to dodge the edit_disable_time.

At the risk of branching this thread, this reminds me of a related PIR that I forgot to post up from a couple years ago - in addition to an edit time limit option. an alternative option that allows poster edits until the post has been replied to... (after which only a moderator can alter it).. I'll start a separate topic unless spuds puts it on his todo list from this mention..
Title: Re: Features or permissions required to delete your own post attachments
Post by: Spuds on January 23, 2022, 10:14:39 am
Tightening up the permissions (which is a nice way of saying properly enforcing them) was one of the 1.1.8 changes.  If you need to play with those they are located the ManageAttachments.subs.php file, look at the canRemoveAttachment() function at the end.

Quote from: Steeley – At the risk of branching this thread, this reminds me of a related PIR that I forgot to post up from a couple years ago - in addition to an edit time limit option. an alternative option that allows poster edits until the post has been replied to... (after which only a moderator can alter it).. I'll start a separate topic unless spuds puts it on his todo list from this mention..
Probably worth its own thread.
Title: Re: Features or permissions required to delete your own post attachments
Post by: Steeley on January 23, 2022, 03:40:58 pm
Quote from: Spuds –
Quote from: Steeley – At the risk of branching this thread, this reminds me of a related PIR that I forgot to post up from a couple years ago - in addition to an edit time limit option. an alternative option that allows poster edits until the post has been replied to... (after which only a moderator can alter it).. I'll start a separate topic unless spuds puts it on his todo list from this mention..
Probably worth its own thread.

DONE (https://www.elkarte.net/community/index.php?topic=6075.msg43199#msg43199)