Hi Chathura,

The two code blocks you have listed seem to be exactly the same. But i
believe the fix you are referring to is passing the teantDomain instead of
the tenantId to the
RealmContext.getRealmService().getTenantManager().getTenantId
method, is it?


Thanks and Regards,

Ruwan


On 4 Dec 2014 15:01, "Chathura Dilan" <[email protected]> wrote:

> Hi All,
>
> There is a bug in APPM ES branch[1] which does not allow mobileapps to
> attach permissions which is defined in the LifeCycle. This bug is inherited
> from ES 1.0.0 and it is fixed in ES 2.0.0.
> However webapps are working fine with a workaround in web app extension
> while the mobile apps breaks. But the workaround is not the best way to
> handle it.
>
>
>         In APPM ES branch GenricExecuter.java class[1] following code
> (Line 102 -110)
>
>
>         String
> stringTenantId=Integer.toString(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
>
>         try{
>
> this.tenantId=RealmContext.getRealmService().getTenantManager().getTenantId(stringTenantId);
>         }
>         catch(Exception e){
>             log.debug("Failed to obtain Tenant id");
>         }
>
>
>
>        Should be replace with following code as in ES 2.0[2]
>
>
>
>        String
> stringTenantId=Integer.toString(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
>
>         try{
>
> this.tenantId=RealmContext.getRealmService().getTenantManager().getTenantId(stringTenantId);
>         }
>         catch(Exception e){
>             log.debug("Failed to obtain Tenant id");
>         }
>
>
>         I tested the fix for both webapp and mobileapp and they worked.
>
>
> [1] -
> https://github.com/wso2/product-es/blob/es-1.0.1-apm-reg/modules/components/jaggery-scxml-executors/src/main/java/org/wso2/jaggery/scxml/generic/GenericExecutor.java
> [2] -
> https://github.com/wso2/product-es/blob/master/modules/components/jaggery-scxml-executors/src/main/java/org/wso2/jaggery/scxml/generic/GenericExecutor.java
>
>
>
> --
> Regards,
>
> Chatura Dilan Perera
> *(Senior Software Engineer** - WSO2 Inc.**)*
> www.dilan.me
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to