How should I define, from which role the user is requesting something?
Hi, I'm stuck in the authorization in Laravel, because one user can have multiple roles, and what I want is not only checking if the user can do this or not, but who they are too.
Because if the user deletes his post as an owner of the post, then the post will get soft delete, while if he deletes the post as a community admin or any other role than the owner, then the post will get status delete, so the owner of the post can see it as deleted.
This is the only reason I don't know what to do, I only think on doing this: when user go to the admin panel, they will have their role also put in there so when they press delete, they will delete the post as an admin rather than the owner of the post. And when they are in their profile, it will be send as an owner, so I can check if this person is owner, then the post (or anything) is getting soft delete, while if they are not, it is status = deleted.
Anybody knows what to do with this? I don't just want to check if this person can or can't but who they are and according to that, how will they delete the post or anything.