Author Topic: Saving a record resets readOnlyMode  (Read 305 times)

Patrique

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Saving a record resets readOnlyMode
« on: December 14, 2020, 12:25:55 pm »
Hi guys,

We use the readOnlyMode to enable users with fewer permissions to update only certain parts of records.

Therefore, we add an update permission (save button) for the role in question and add a call like this to the onAppInitialized event:

Code: [Select]
if(app.isUserInRole("Administration")){
    //alle Rechte     
}else if(app.isUserInRole("Sales")){
    //darf nur x, y, z editieren
    app.readOnlyMode(true, {exclude: [
        "x"
        ,"y"
        ,"z"
    ]});
    app.setToolbarButtonMode("brixxToolbarSaveRecord", "enabled");
}else{
    //keine Rechte
    app.readOnlyMode();
}

After the user edited the data and uses the safe button this resets the readOnlyMode for all fields and the user can edit everything.

Could you please fix this issue?

Thanks,
Patrique
« Last Edit: December 14, 2020, 12:30:30 pm by Patrique »

Patrique

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Saving a record resets readOnlyMode
« Reply #1 on: December 14, 2020, 12:29:36 pm »
I need to add some priority to this as we cannot even work around this by adding the readOnlyMode code to onRecordSaved. It's not working.