Topic: Handling Access Setup for Version2 of a Module

Hello,

I have module clearing and there are 10 companies on it. Now I want to launch version 2 of this module without changing the first version. clearingv2. I don't want all clients to shift to this new version.

When I do this and install this new version as a new module and shift any of these clients to this new version. I lost all security settings for this new version.

Since there are many roles in each company it is very tedious to reassign all security settings.

Is there any way that my version2 inherits the security settings of version1?

Your support is highly appreciated.

www.boxygen.pk

Re: Handling Access Setup for Version2 of a Module

Version 2 should be a new module (with it's own distinct name) in your case as you want to have both versions concurrently with only a subset using the new version. A separate script in your new version module must independently migrate the security settings as needed or have it set anew in it.

Re: Handling Access Setup for Version2 of a Module

My hooks.php is almost the same except below

Version 1

define ('SS_CLEARINGINVOICE', 105<<8);

Version2

define ('SS_CLEARINGINVOICEv2', 105<<8);

But the resulting Section and Area Numbers are different

Version1

[Section5006336] => 1
    [Area5006436] => 1
    [Area5006437] => 1
    [Area5006438] => 1
    [Area5006439] => 1
    [Area5006440] => 1
    [Area5006441] => 1
    [Area5006442] => 1
    [Area5006443] => 1
    [Area5006444] => 1
    [Area5006445] => 1
    [Area5006446] => 1
    [Area5006447] => 1
    [Area5006448] => 1
    [Area5006449] => 1
    [Area5006450] => 1
    [Area5006451] => 1

Version2

[Section6054912] => 1
    [Area6055012] => 1
    [Area6055013] => 1
    [Area6055014] => 1
    [Area6055015] => 1
    [Area6055016] => 1
    [Area6055017] => 1
    [Area6055018] => 1
    [Area6055019] => 1
    [Area6055020] => 1
    [Area6055021] => 1
    [Area6055022] => 1
    [Area6055023] => 1
    [Area6055024] => 1
    [Area6055025] => 1
    [Area6055026] => 1
    [Area6055027] => 1

I am trying to understand that which factor is bringing this difference in code of both Versions.

My First version is installed on 76th Position and New Version is installed in 92nd Position in installed_extensions.php.

@apmuthu, Can you help me to understand the logic. Its bit tricky using bitwise operators.

www.boxygen.pk

Re: Handling Access Setup for Version2 of a Module

Wonder if the constants are case sensitive and can contain numbers - SS_CLEARINGINVOICEv2

FA cleverly manages to get new sequential values if existing ones are occupied (105).

105 * 256 (shift left 8) = 38400.

Obviously you have tried to install, remove and re-install the module several times.

Try it on a fresh FA install with no other module and see what comes of it.

Re: Handling Access Setup for Version2 of a Module

@boxygen - this doesn't answer your question; could you just rename the module, keeping the existing security settings?

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: Handling Access Setup for Version2 of a Module

I already have renamed the module. My basic module is clearing and the version 2 is clearingv2. Security settings are just same in hooks.php except the one mentioned in post#3

www.boxygen.pk

Re: Handling Access Setup for Version2 of a Module

On Fresh Installation

Version 1

[Section353280] => 1
    [Area353380] => 1
    [Area353381] => 1
    [Area353382] => 1
    [Area353383] => 1
    [Area353384] => 1
    [Area353385] => 1
    [Area353386] => 1
    [Area353387] => 1
    [Area353388] => 1
    [Area353389] => 1
    [Area353390] => 1
    [Area353391] => 1
    [Area353392] => 1
    [Area353393] => 1
    [Area353394] => 1
    [Area353365] => 1
    

Version2

[Section418816] => 1
    [Area418916] => 1
    [Area418917] => 1
    [Area418918] => 1
    [Area418919] => 1
    [Area418920] => 1
    [Area418921] => 1
    [Area418922] => 1
    [Area418923] => 1
    [Area418924] => 1
    [Area418925] => 1
    [Area418926] => 1
    [Area418927] => 1
    [Area418928] => 1
    [Area418929] => 1
    [Area418930] => 1
    [Area418931] => 1
    

@poncho1234 YOu can take any module and rename it and install it. The Section and Area Codes will be different.

My Problem is to copy the Section and Area Settings from Version 1 to Version 2.

www.boxygen.pk