Answer the question
In order to leave comments, you need to log in
How can getters and actions be restricted to user groups in Vue?
The laravel+vue project uses websanova/vue-auth JWT authorization . After authorization, information about the user is stored in the storage. It contains the role field, which has two values: admin or member. In some Vue components, I only get information if role == admin
. Due to the lack of understanding of the storage operation, the question arises, if I have a getter to get a list of invites, how to properly protect it from access by a regular user? In the body of the getter, just write a check about the compliance of the role? Or are there better options
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question