Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Restrict access in record
#1
Hi,
In Documents module i added a new uitype 10 field named 'Company' linked with Users module. I changed privileges for Documents module into private in 'Sharing Access', so users can only see theirs records. Is there any way to display a record also to corresponding user who is added in 'Company' field (uitype 10 field)??
For example:
User 'Arjan' has created a record and in 'Company' field he chose 'Atis' user. This record can be seen only by Arjan. I want Atis to see it too.

Thanks Smile


Attached Files Image(s)
   
Reply
#2
Hi,

You will have to add an access permission hook with your logic. Basically, an SQL statement that returns the set of document IDs that are related to the user based on your new field.

This is explained here:

http://corebos.org/documentation/doku.php?id=en:devel:corebos_permission_hooks

and there is an example here:

https://github.com/tsolucio/corebos/blob/master/build/HelperScripts/coreBOSEventsPermission.php

precisely, you have to add the addToUserPermission hook and return an SQL similar to

https://github.com/tsolucio/corebos/blob/master/build/HelperScripts/coreBOSEventsPermission.php#L121

Welcome to coreBOS :-)
Joe
TSolucio
Reply
#3
You will also have to implement corebos.permissions.ispermitted or define a RAC business rule to permit the actions. At least the view action.

Keep asking
Joe
TSolucio
Reply
#4
(06-03-2017, 09:57 PM)joebordes Wrote: You will also have to implement corebos.permissions.ispermitted or define a RAC business rule to permit the actions. At least the view action.

Keep asking


Thank you very much Joe  Smile
You really helped me a lot.
I solved my problem.
Reply
#5
I am very happy. This is what we have been working for the past years, since we forked vtiger CRM: to create an infrastructure you can use to solve problems, not to add more :-)
Joe
TSolucio
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)