mnt93
July 16, 2024, 8:31am
1
Hello,
I have an API that checks whether a member is logged in or not. After this API works, when I click on the link, it always redirects to the forbidden url. Even if the member is logged in, it goes to that url. What should I do?
It returns "403" when logged in,
Here you can see the route file and api,
Thanks in advance.
Teodor
July 16, 2024, 8:33am
2
Most probably your logged user permission doesn't match the permission you require: Member
mnt93
July 16, 2024, 8:44am
3
Where can I find these permission levels?
Teodor
July 16, 2024, 8:46am
4
Well in the security provider settings, you set them up there.
1 Like
mnt93
July 16, 2024, 8:52am
5
Thanks!
It works fine when there is only one value in the permission section, but it does not work when I enter 2 values in this way.
Teodor
July 16, 2024, 9:02am
6
Well your user needs both permissions this way.
Note this is not Roles, but Permissions. You might want to rethink the way you set up your permissions.
1 Like
Hey @mnt93 , it may be more complicated than what you're looking for, but here's how I implemented a role based system.
I'm trying to determine the best approach for a RBAC and ACL system. I want to store the roles and ACLs in the DB for easy updating in the future, so I don't think I can use the Roles and Permissions feature in the Security Provider. The Security Provider will stay a simple "is the user logged in" enforcer.
At the moment I'm thinking I'll need to add DB queries at the beginning of my API's Request Methods to check if the user has the appropriate rights before running any of the steps.
[image]
…
2 Likes
mnt93
July 16, 2024, 4:30pm
8
Hey, it was working before I update wappler, now it doesn’t idk why
I will check it, thank you