serenity-is / Serenity

Business Apps Made Simple with Asp.Net Core MVC / TypeScript
https://serenity.is
MIT License
2.59k stars 796 forks source link

When switching from view mode to edit mode, field modify permissions are not applied to editors #6545

Closed volkanceylan closed 10 months ago

volkanceylan commented 2 years ago

We need to call this.propertyGrid.updateInterface either from EntityDialog.updateInterface or edit button click. Need to analyse advantages / side effects of both. Also a method in EntityDialog where we can intercept / override / extend switching to edit mode would be nice in case someone wants to execute some custom code while switching to edit mode.

What did you expect to happen?

The field with modify permission becomes readonly after switching to edit mode

How to reproduce?

Set modify permission for a field and use edit mode for an entity dialog, the input does not become readonly, though the permission is checked server side (so it is an UI issue).

furkanevran commented 1 year ago

6545 can't repro on 6.8.2

I added ModifyPermissionAttribute to the Email and PhoneNumber fields, which seem to work as expected. I've also overridden the useViewMode method to return true on the first take and removed it on the second.