Sorry you are not authorized to edit this record!

Status
Not open for further replies.

gnavarro

Member
Hi,

Suddenly one of my user groups stop having access to edit records for one specific list!

In this list the user only can edit 3 fields (one is yes/no and the other 2 show wen selecting yes in the first one). when editing records and no changes are applied if we click on submit, the form submits and redirects to the list as expected. But if when editing we change the yes/no element value and try to submit, the form returns the message "Sorry you are not authorized to edit this record"!

You can test this in the following list using the FisioLAR COLAB login access that you can find in my sites:
https://www.fisiolar.pt/index.php/pt/tratamentos-fisioterapia

Please edit one of the records and change the element 'Conclu?do' to 'sim'(yes) and try to submit.

All list and yes/no element access parameters are correct and unchanged so why am I seeing this message? Am I missing something?
 
Clicking on "Sim" you'll get JS errors
"Cannot read property 'update' of null"
it's trying to update fb_tratamento_fisiot___notific

Not sure if this is the reason.
 
Hi Troester,

Thanks for your help!

I've unpublished that JS part in the element and the bug persists. Also unpublished element fb_tratamento_fisiot___notific and bug persists.

What other things could generate this anomaly?
 
It's not a "bug", it's a "feature".

You have a 'caneditrow' plugin, which requires "Concluido" to equal "0" to allow editing.

If you look at that plugin, there's an option, "Run on Submit", the tooltip for which says ...

By default, this plugin will run as part of ACL checking on form submission. If you are using a form element that a user can change (so may be set to a value that prevents editing on submission), you will need to set this to No.

... which pretty much sums it up. By default, we run the caneditrow plugin on form submission (not just on load or in list view) to prevent people from directly submitting edits to rows they aren't allowed to edit. But as the tooltip says, if you allow users to modify the element you are using for the access control, and they change it to a value that prevents access ... well, you can see what happens.

I've set that option to No.

I've also set the option below that, "Run on Failed Validation", to No, for similar reasons:

If you allow your users to modify the element which controls edit access, you may wish to set this to No, otherwise if they submit the form with this element set, and the form fails validatoin, the resulting reload won't let them edit any more.

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

Thank you.

Staff online

Members online

Back
Top