Page 1 of 1

Editing an entry without permissions

Posted: 2019-11-10 18:56
by amootoo
Hi,
For security reasons I have to disable(in permissions) a user from editing an entry after it is created, but I would like to add a button or a way so the user can add a time to an entry later.

Hope it makes sense.

Re: Editing an entry without permissions

Posted: 2019-11-14 18:21
by amootoo
Do you know how can that be achieved?

Re: Editing an entry without permissions

Posted: 2019-11-14 18:33
by jsetzer
Hi,

maybe this post here can help you:
viewtopic.php?f=11&t=3289&p=11389#p11389

I have added a button for "locking" a record so the user cannot edit any more. In this state there is a button for "editing" that records.

Technically speaking I'm just changing to record owner to "admin" (user cannot edit any more) or to current user (user can edit). It is important to change the permissions on that table to grant editing rights to "owner", only.

You can use the built-in function set_record_owner($tablename, $primaryKey, $newOwnerMemberID) to toggle the ownership between different users.

ezgif.com-optimize (2).gif
ezgif.com-optimize (2).gif (211.23 KiB) Viewed 2990 times

Re: Editing an entry without permissions

Posted: 2019-11-15 04:16
by amootoo
Thanks for the reply!
I'll try that.