Hello everyone, I am developing an app with outsystems that allows access to certain screens depending on two roles that I have already created What should I do so that after the user logs in, due to the role that has fence to home or home2. Thanks for all =)
Now is perfect, is using, a data action, where when the User does the login, he checks which role has the user, and he redirects to a screen depending on the role :)
Enjoy, anything says, check if it's the solution you are trying to find.
Data Action
Checking role with the data action on the login action.
Kind Regards,
Márcio C.
Check if the user has that role with its userid, and then retrieve if it has or not, and check to which place he goes
@Marcio Carvalho thank you for you answer, but, I don't know where or how to do that
I did on reactive, but you can do (copy/paste) the same logic on mobile, no worries
To achieve this in your OutSystems app, you can use the Role-based access control (RBAC) feature. Here's a simple outline of what you can do:
Define Roles: Ensure you have already created the roles (e.g., "fence" and "home2") in your OutSystems application.
Assign Roles to Users: Assign the roles to users during user management or registration.
Implement Screen Access Logic: In your app, implement logic to check the user's role after login and redirect them accordingly.
Here's a basic example of how you might implement this logic:
javascriptCopy code// Assuming you have a user variable with the user's role storedif (User.Role = "fence") { // Redirect to the "Fence Screen" Navigate(YourFenceScreen);} else if (User.Role = "home2") { // Redirect to the "Home2 Screen" Navigate(YourHome2Screen);} else { // Redirect to a default screen or show an error message Navigate(DefaultScreen);}
Make sure to replace Your Fence Screen, YourHome2Screen, and DefaultScreen with the actual screen names in your app.