Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
944 Visninger

I have a model form view. I want to make it (as a whole, not just some fields) editable only for author and admin, but not other users.
And there is a M2M field which should not be editable at all - you either create or delete it.

How can I do that?
It seems like its possible to configure access via group-based policies in security/*.csv. But what s about cases when it should be configured based on some other fields (maybe even calculated during runtime)?

Avatar
Kassér
Bedste svar

You can make a separate group for the users where you will give read, write access of your form view model and give only read, create and delete access of that M2M relational model in csv file. For your case, you can write an onchange method where you will check any field value to assign or unassign the user of a specific group and that write access rights for that group.


Thanks & Regards, 

 

Brain Station 23 Ltd. 

Mobile: (+880) 1404055226 

Email: sales@brainstation-23.com 

Web: https://brainstation-23.com/ 

Address: (Building-1) 8th Floor, 2 Bir Uttam AK Khandakar Road, Mohakhali C/A, Dhaka 1212, Bangladesh 

Avatar
Kassér