[SOLVED] Lock Row Plugin of F2 missing

Status
Not open for further replies.
Confirmed.
I assume it's working like the canEditRow
NOTE the above precedence was change on 12/1/2017. The plugin now takes precedence over the list's normal group/user ACLs. If the plugin returns true or false, this overrides the list's ACLs.
Which doesn't make sense in case of lockrow.
 
Ah, I see the problem. It's returning true or false on canEdit ... it needs updating to the "new" way canEdit works, which is that it can now return null if it has no opinion. Used to be that canEdit had to return true or false, and always overrode ACL's. A year or so ago I changed that so canEdit can return null, and the access then punts to the normal ACL mechanism.

I think I just need to change it so if it's not returning false (row is locked) it returns null instead of true.

-- hugh
 
Hi Hugh,
many thanks. I've made an update from github and it looks good. I'm combining now lockrow with caneditrow to prevent updating older records.
If you have time, it would be perfect, to hide the lock icons on not editable records... it's just on my wishlist ;)
Cheers,
Bianka
 
How about if the row is locked because it's locked, rather than because of normal ACLs?

Doing that would prevent the owner form unlocking the row from the list.

So I'm guessing the options for a "Show Icon when not Editable" would be "Yes / No / ACLs Only" (or perhaps "Show Unlock for Lock Owner").

-- hugh
 
PS, I've started adding the code to allow locking from list view as well as unlocking. Don't know if that's useful to you, but it's something I always intended to do, just never got round to it.

-- hugh
 
Here's the commit for the option to hide the icons if the user doesn't have edit access.

https://github.com/Fabrik/fabrik/commit/39882d3c976fd2d31873212ab08e11c744e06919

And there's a commit after that which implements the icon naming options, so you can use different icons.

Note that even if the user doesn't have ACL access, if they own the lock, they will still see the icon and be able to unlock the row. The AJAX unlocking from the list is not ACL protected. The AJAX unlock only checks to see if the lock is owned by the same user.

(It's unlikely the situation of a lock owner not having edit access would ever arise, as they would need edit access to lock it in the first place, but could happen)

When I implement AJAX locking, it will be ACL protected. But I'll leave unlocking with the only test being "does this user own the lock".

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top