I think all the users and roles are loaded while mobile application is launched.

I am not sure but I just need to know that can I use checkrole function to check the current user has the role or not in offline mode.

Will the checkrole function work while I lost my internet connectivity?


Please anyone let me know the clarity about this. I need to know whcih functions can I use in offline mode. 

Hi Manish,

Your question has been posted before. CheckRole is only available on the server-side.

Check out this post in which Jorge Martins' answer clarifies this topic.

Regards,

Nordin

There is actually a way to check roles on the client-side using the Javascript API. 

In my above linked post Jorge Martins also provides a link to the following post and explains how to use it:

https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/JavaScript_API/Security

Regards,

Nordin

Nordin Ahdi wrote:

Hi Manish,

Your question has been posted before. CheckRole is only available on the server-side.

Check out this post in which Jorge Martins' answer clarifies this topic.

Regards,

Nordin

Hi Nordin,

Thanks but
I have a confusion so I am asking again.

Like when I tried to login the mobile app with super admin user. I have 3 pages there like (one for all user, one for registered and one for super admin user.)

I was surprised that when I go offline and try to access the super admin page It was loaded successfully.

This time I was only online when I login with super admin user but after login I went offline and see that now I can access the super admin page.


So just asking that outsystem internally check the role or not in offline mode. or all the roles are loaded in offline mode. I see that the page can only access when checkrole action must run.  But I have confusion for this.

Please clearly about this scenario.


Regards,

Manish K


Hi Manish,

As Jorge Martins explains in the linked post:

"Be careful though, this role-checking mechanics would force the app to be online every time a role-check is performed, as your app would be calling a REST endpoint on the server."

So as it seems, even though you have put your app in offline mode, it was forced to be online to perform a role check and as a result your super admin user was allowed to access the page.

Regards,

Nordin