콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
959 화면

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)?

아바타
취소
베스트 답변

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 

아바타
취소