Results 1 to 9 of 9

Thread: Custom Module with SecuritySuite

  1. #1
    Join Date
    Apr 2010
    Posts
    10

    Default Custom Module with SecuritySuite

    I'm about to get driven up a wall here. I've created a custom module and I want to control the records in the same way that I'm controlling the Contacts records - Group Members can only view contacts assigned to them. With Contacts records, all works well. With my custom module, it doesn't.

    Here is a screenshot of my relationships.


    Original sap_applianceslist_securitygroupsMetaData.php code:
    PHP Code:
    <?php
    // created: 2010-04-19 14:59:58
    $dictionary["sap_applianceslist_securitygroups"] = array (
      
    'true_relationship_type' => 'many-to-many',
      
    'relationships' => 
      array (
        
    'sap_applianceslist_securitygroups' => 
        array (
          
    'lhs_module' => 'SAP_AppliancesList',
          
    'lhs_table' => 'sap_applianceslist',
          
    'lhs_key' => 'id',
          
    'rhs_module' => 'SecurityGroups',
          
    'rhs_table' => 'securitygroups',
          
    'rhs_key' => 'id',
          
    'relationship_type' => 'many-to-many',
          
    'join_table' => 'sap_appliancuritygroups_c',
          
    'join_key_lhs' => 'sap_applia22daceslist_ida',
          
    'join_key_rhs' => 'sap_applia72f8ygroups_idb',
        ),
      ),
      
    'table' => 'sap_appliancuritygroups_c',
      
    'fields' => 
      array (
        
    => 
        array (
          
    'name' => 'id',
          
    'type' => 'varchar',
          
    'len' => 36,
        ),
        
    => 
        array (
          
    'name' => 'date_modified',
          
    'type' => 'datetime',
        ),
        
    => 
        array (
          
    'name' => 'deleted',
          
    'type' => 'bool',
          
    'len' => '1',
          
    'default' => '0',
          
    'required' => true,
        ),
        
    => 
        array (
          
    'name' => 'sap_applia22daceslist_ida',
          
    'type' => 'varchar',
          
    'len' => 36,
        ),
        
    => 
        array (
          
    'name' => 'sap_applia72f8ygroups_idb',
          
    'type' => 'varchar',
          
    'len' => 36,
        ),
      ),
      
    'indices' => 
      array (
        
    => 
        array (
          
    'name' => 'sap_appliansecuritygroupsspk',
          
    'type' => 'primary',
          
    'fields' => 
          array (
            
    => 'id',
          ),
        ),
        
    => 
        array (
          
    'name' => 'sap_appliansecuritygroups_alt',
          
    'type' => 'alternate_key',
          
    'fields' => 
          array (
            
    => 'sap_applia22daceslist_ida',
            
    => 'sap_applia72f8ygroups_idb',
          ),
        ),
      ),
    );
    ?>
    New sap_applianceslist_securitygroupsMetaData.php code as specified in the manual.
    PHP Code:
    <?php
    $dictionary
    ["sap_applianceslist_securitygroups"] = array (
    'true_relationship_type' => 'many-to-many',
    'relationships' =>
    array (
        
    ' sap_applianceslist _securitygroups' =>
        array (
        
    'lhs_module' => 'SecurityGroups',
        
    'lhs_table' => 'securitygroups',
        
    'lhs_key' => 'id',
        
    'rhs_module' => 'SAP_AppliancesList',
        
    'rhs_table' => 'sap_applianceslist',
        
    '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' => ' SAP_AppliancesList',
        ),
    ),
    );
    ?>
    I then rebuild the relationships, but still I don't see the AppliancesList according to Group. Nothing shows on the list at all. I've restored the original code and tried painstakingly to recreate the file properly, several times.

    What can I do?

  2. #2
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: Custom Module with SecuritySuite

    What version of Sugar are you on? If you follow the manual it should work. I'll verify on your version that it does.

  3. #3
    Join Date
    Apr 2010
    Posts
    10

    Default Re: Custom Module with SecuritySuite

    Quote Originally Posted by eggsurplus View Post
    What version of Sugar are you on? If you follow the manual it should work. I'll verify on your version that it does.
    I'm using 5.5.1 CE, and I'm very much trying to follow the manual.

  4. #4
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: Custom Module with SecuritySuite

    I'll try it on 5.5.1. It may be that there was a significant change in 5.5.1 that was not caught for getting custom module support working.

  5. #5
    Join Date
    Apr 2010
    Posts
    10

    Default Re: Custom Module with SecuritySuite

    Much appreciated. I've been trying it additionally by creating very small dummy modules, and I'm not having success there either on the dummies.

    It's working jim-dandy on the standard modules such as contacts or cases, however, with all else being equal regarding users/roles/security groups.
    Last edited by thinkwelldesigns; 2010-04-19 at 11:25 PM.

  6. #6
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: Custom Module with SecuritySuite

    Found it. For some reason copying and pasting directly from the PDF causes a bunch of spaces. There are three added spaces throughout the version you have. Here's a correct version:

    PHP Code:
    <?php
    $dictionary
    ["sap_applianceslist_securitygroups"] = array (
    'true_relationship_type' => 'many-to-many',
    'relationships' =>
    array (
        
    'sap_applianceslist_securitygroups' =>
        array (
        
    'lhs_module' => 'SecurityGroups',
        
    'lhs_table' => 'securitygroups',
        
    'lhs_key' => 'id',
        
    'rhs_module' => 'SAP_AppliancesList',
        
    'rhs_table' => 'sap_applianceslist',
        
    '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' => 'SAP_AppliancesList',
        ),
    ),
    );
    ?>

  7. #7
    Join Date
    Apr 2010
    Posts
    10

    Default Re: Custom Module with SecuritySuite

    So the solution, once found, really was simple...

    Thank you so much. That works perfectly on two modules I've tried. Thanks so much for an excellent module.

  8. #8
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: Custom Module with SecuritySuite

    Not a problem. While digging into this issue though I did run into an issue with inheritance and with shortcuts disappearing for custom modules in 5.5.1. I'll have a fix out shortly that can be downloaded.

  9. #9
    RLJB is offline Senior Member
    Join Date
    Oct 2008
    Location
    Sydney - Australia
    Posts
    21

    Default Re: Custom Module with SecuritySuite

    Hi

    I have installed SecruitySuite. I turned on "Non Inheritable" and the shortcuts have disappeared? Even when I turn off "Non Inheritable" the shortcuts are still not there?

    Can you advise how to fix?

    Version is 5.5.0

    Thanks

    R.

    UPDATE: Sorry I found the solution on the Sugarforge forum here: http://www.sugarforge.org/forum/foru...&forum_id=2544
    Last edited by RLJB; 2010-06-02 at 04:21 AM. Reason: added version number

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. SecuritySuite Alpha available for Testing
    By eggsurplus in forum Downloads
    Replies: 207
    Last Post: 2010-03-03, 10:21 PM
  2. SecuritySuite (Teams)
    By salesagility in forum General Discussion
    Replies: 3
    Last Post: 2009-07-31, 01:45 PM
  3. securitysuite
    By akkimca in forum Help
    Replies: 5
    Last Post: 2009-02-27, 01:59 AM
  4. SecuritySuite 0.4 question
    By mbruni in forum Help
    Replies: 2
    Last Post: 2008-06-16, 01:27 PM
  5. How translate a Module (SecuritySuite) ???
    By sugarzen in forum Translators
    Replies: 2
    Last Post: 2008-05-27, 12:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •