Check Role function in Blank Module

Hi,


I tried the CheckRole function using a "Blank" module and found out that it is always returning "False".

If I use that function in a "Responsive" module, the function is working as expected.

What is wrong with the "Blank" module or did I do something wrong ? Please advise. Thanks!


Ye Yint

Solution

Hi Ye,


What do you mean with a Blank module? Which role are you validating? If it's the registered role and you're using the default Login Mechanism, don't forget to change the User Provider of the module to "Users".


Solution

Márcio Lima wrote:

Hi Ye,


What do you mean with a Blank module? Which role are you validating? If it's the registered role and you're using the default Login Mechanism, don't forget to change the User Provider of the module to "Users".


He is Talking about the Core Module from Web App Tutorials. The one that does not have a Webpages but only Database tables and Actions


@ye yint :  Can you please share a screenshot for us to see and understand what you are trying to do.


I can see you had similar problem earlier and you had moved the function directly  to the Responsive module and It had solved issue for you earlier.


Is that particular user tagged to the role you are looking for  ?


coder kamath wrote:

Márcio Lima wrote:

Hi Ye,


What do you mean with a Blank module? Which role are you validating? If it's the registered role and you're using the default Login Mechanism, don't forget to change the User Provider of the module to "Users".


He is Talking about the Core Module from Web App Tutorials. The one that does not have a Webpages but only Database tables and Actions


@ye yint :  Can you please share a screenshot for us to see and understand what you are trying to do.


I can see you had similar problem earlier and you had moved the function directly  to the Responsive module and It had solved issue for you earlier.


Is that particular user tagged to the role you are looking for  ?



Hi Sir,

I added a new role in a blank module like this

And trying to use the "CheckNewUserRole" function of that role

Even if I grant the users with that role, I found out that "HasRole" output from that "CheckNewUserRole" function is always returning "False".


Ye Yint

As Marcio said check the user provider. By default a "Blank" espace will have the user provider set to" Current Espace" as per below. You need to set it to "User"


John Williams wrote:

As Marcio said check the user provider. By default a "Blank" espace will have the user provider set to" Current Espace" as per below. You need to set it to "User"


Hi Sir,

Thanks for reply. After I change the User Provider Module, the checkrole function is working fine. 


Regards,

Ye Yint


Márcio Lima wrote:

Hi Ye,


What do you mean with a Blank module? Which role are you validating? If it's the registered role and you're using the default Login Mechanism, don't forget to change the User Provider of the module to "Users".


Hi Sir,

Thanks for reply. After I change the User Provider Module, the function is working fine. 

Regards,

Ye Yint