Reactive web Application Check Role

HI All,

Application : Reactive Web 

I wanted to show one menu to specific role (i.e Manager role) I have done the following to achieve this.

 

"CheckManagerRole" contains 

// check if the current user has the 'Manager' role

$parameters.IsManager = $public.Security.checkIfCurrentUserHasRole($roles.Manager);


"IsManagerRole" contains

IsManagerRole = IsManager


But always I am getting False in IsManagerRole even if the user have Manger role. To be more specific the user have Employee and Manager Role. Can any one let me know whats went wrong here.....

Thanks.....

Hi Rohan,

May be in your assignment has issue, you need to pass value return from Javascript 

https://www.outsystems.com/forums/discussion/62878/how-to-define-seen-or-unseen-button-with-roles-in-reactive-app/ 

Follow this question it will helo you.

Assignment be like


Regards

Rahul

Solution

Hi Rohan,

Your Javascript node should have an output parameter to which you assign the outcome of the checkIfCurrentUserHasRole() function.

Right after the Javascript node, you need to assign the output of the Javascript node to your Local Variable like this.

Just this morning I have attached a sample OML in this post. Check it out if you want.

Regards,

Nordin

Solution

Rahul Sahu wrote:

Hi Rohan,

May be in your assignment has issue, you need to pass value return from Javascript 

https://www.outsystems.com/forums/discussion/62878/how-to-define-seen-or-unseen-button-with-roles-in-reactive-app/ 

Follow this question it will helo you.

Assignment be like


Regards

Rahul

 Hi Rahul,

Can't able to get CheckManagerRole in the scope. See below.

 

 thanks.....

Rohan Hanumante wrote:

HI All,

Application : Reactive Web 

I wanted to show one menu to specific role (i.e Manager role) I have done the following to achieve this.

 

"CheckManagerRole" contains 

// check if the current user has the 'Manager' role

$parameters.IsManager = $public.Security.checkIfCurrentUserHasRole($roles.Manager);


"IsManagerRole" contains

IsManagerRole = IsManager


But always I am getting False in IsManagerRole even if the user have Manger role. To be more specific the user have Employee and Manager Role. Can any one let me know whats went wrong here.....

Thanks.....

 Hi Rohan,

You have to assign an output parameter of boolean type which checks the role to your javascript and in assign you should write :- IsManager=<NameOfJavascript>.<OutputParameter>

Regards,

Divyanshu Pathak

 

Rohan Hanumante wrote:

Rahul Sahu wrote:

Hi Rohan,

May be in your assignment has issue, you need to pass value return from Javascript 

https://www.outsystems.com/forums/discussion/62878/how-to-define-seen-or-unseen-button-with-roles-in-reactive-app/ 

Follow this question it will helo you.

Assignment be like


Regards

Rahul

 Hi Rahul,

Can't able to get CheckManagerRole in the scope. See below.

 

 thanks.....

 

 Hi ROhan

assignment be like return value from Javascript action not check direct role .

As i provide one link in post look into it and Also @nordin has provided same .


Cheers