Can anyone offer some direction on using Security Groups Management on a custom module created in Module Builder? I created a Vacation moduleā¦ and my first attempt was a many to one relationship to security groups management, but alas, the user in the security group couldnāt see records assigned to his security group despite the role being setup appropriately to allow for this. I saw in the CONTACTS module, it was a many to many relationship to Security Groups Management, so I changed it and redeployed the VACATION module and repaired the database but alas, the user still canāt see the records to which he is given permission through group membership.
Iām hoping someone has succeeded in this and can help. The only differences I can see to my implementation vs. CONTACTS areā¦
- The relationship was made from security_groups to contacts whereas Iām making it from contacts to security_groups
AND
- The display panel from contacts is blank in the CONTACTS relationship whereas mine is ādefaultā since I cannot make it blank through the relationships management interface.
Any help is appreciatedā¦ (and before you say it @pawan6782, Security Groups are still working in my other modules :S )
Thanks,
sieberta
OK, figured this one out on my ownā¦
- If you have SecuritySuite Premium, there is a tool called āhookup toolā that creates the relationship for you.
- If you donāt have the paid-for version, you can create the many-to-many relationship and then edit the metadata file that creates the relationship.
The details are here: http://dl.sugarforge.org/securitysuite/securitysuite-old/OlderFiles/SecuritySuite_Documentation_2.1.pdf
And for copy/paste purposes, you can use my exampleā¦
$dictionary["vaca_vacation_securitygroups"] = array(
'true_relationship_type' => 'many-to-many',
'relationships' =>
array(
'vaca_vacation_securitygroups' =>
array(
'lhs_module' => 'SecurityGroups',
'lhs_table' => 'securitygroups',
'lhs_key' => 'id',
'rhs_module' => 'vaca_Vacation',
'rhs_table' => 'vaca_vacation',
'rhs_key' => 'id',
'join_table' => 'securitygroups_records',
'join_key_lhs' => 'securitygroup_id',
'join_key_rhs' => 'record_id',
'relationship_type' => 'many-to-many',
'relationship_role_column' => 'module',
'relationship_role_column_value' => 'vaca_Vacation',
),
),
);
This information was extremely difficult to findā¦ Iām hoping to do my part to contribute to the documentation of SuiteCRM and included Modules.
The other thing that was unclear to me from the documentation PDF was whether or not I was to include the key at the beginning of the module nameā¦ and the answer is yes, in all locations you include the key.
sieberta
5 Likes
it is useful, thank you sieberta
Hi sieberta,
Thanks for you help.
My original module file is: mi modulo original es: fph_historia_clinica
ihave the automatic generate relationshi file: fph_historia_clinica_securitygroups_1_fph_historia_clinica.php
in (custom/Extension/modules/fph_historia_clinica/Ext/Layoutdefs)
which are the correct data ?
ārhs_moduleā => āYOURMODULENAMEā,
ārhs_tableā => āYOURCUSTOMMODULEā,
thanks.
Very THANK YOU for this post, it helps me.
SecuritySuite_Documentation_2.1.zip (334.9 KB)
For anyone trying to implement this, the link to original documentation does not work. I found a copy and have uploaded it here.
Alsoā¦KEY!!! Do not just edit the file. If you just edit it as instructed it will not work. You have to remove all other code from the file and replace it exactly with only the code in the documentaiton (with the appropriate substitutions for your module name). Then do a role repair, I also did a quick repair and rebuild and it works.