I created one application where I want to hide the dashboard menu from normal user but I am facing some issues while in IF true condition where when I pass the role name.
CheckApproverRole()
It does not accept.
Malalai Habib wrote:
Dear Carlos,
Thank you for your reply I am very new in outsystem I followed all the steps you mention but I think it is not what I want I just wast to hide one of the dashboard menu from the some users which I couldn't hide after the above steps.
Can you share the oml with your logic?
You are doing the logic in the wrong place, you must do on the menu, check the pic bellow
I did the changes on the oml attached check if will work
Hi Malalai,
Your CheckApproverRole() action works only server side.
In Reactive Web Apps and Mobile Apps you can use the Javascript API in order to perform client side role checking.
Here are some other related posts.
https://www.outsystems.com/forums/discussion/37920/role-based-menu-and-homescreen-in-mobile/
https://www.outsystems.com/forums/discussion/26565/define-role-access-to-a-mobile-app/#Post99921
Regards,
Nordin
Hi Malalai, to check role in the reactive you must use the Javascript API as Nordin said
Here in this post you have an example of how to do it, with the oml to help you to replicate the logic
https://www.outsystems.com/forums/discussion/61033/screen-visibility/#Post236790
Best regards
Carlos Lessa
Carlos Lessa wrote:
Thank you dear it is working fine now.
Good I could help you
$parameters.IsApprover = $public.Security.checkIfCurrentUserHasRole($roles.Approver);
Your pics are blank
The condition here in the pic is the local variable = HasApproverRole
and inside the JS you need to have this:
Check the oml attached, adapted to Approver role
Go menu webblock in common flow create action on OnInitialize" to check role.
After that this output parameter assign in local variable and use local variable to show hide property.
Regards
Rahul Sahu
Rahul Sahu wrote:
I did not understand kindly elaborate it little more.
Thank you. Rahul.