El 04/04/17 a les 15:58, Khurram Shahzad ha escrit:
In the user context you have the groups which the user belongs to. Then
using the states attribute of the page/group (set using
view_attributes), you can hide the page/group if the user groups does
not contain the Id of your group.
Something like:
@classmethod
def view_attributes(cls):
return [('xpath/to/your/page', 'states', {
'invisible': ~In(Id(<module>, <id_group>), Eval('groups', []))})]
Where <module> is the module which created the group and <id_group> is
the xml_id of the group you want to test.
Another option is to set the name attribute of the group/page to a
related field and then restrict the access to this field. This is
usefull if the page only contains one field.
Hope it helps
--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk