Laravel Vue SPA Issue Tracker part 17: vuejs permissions

preview_player
Показать описание
Today on our laravel vue spa issue tracker part 17 we are starting implementing front-end permissions check.

In order to do that we had to create a new helper called CAN and which checks the permissions of the current user from the store.
We also create a new middleware/gate so we can apply that helper inside.

Рекомендации по теме
Комментарии
Автор

Sorry about the yellow thing on the background, the sun trolled me today!

Also, when we changed the can method, we introduced a bug! I'm going to explain it and fix it on the next episode, hopefully I won't forget about it.

ProgrammingwithPeter
Автор

good job Peter, I work with NuxtJs, and your playlist its a breath take, to learning Nuxt and Laravel Passport.

Автор

You have an error in your algorithm, suppose you want to add multiple permissions to the meta the middleware will always take the last permission in the loop and set the result of canEnter depending on it. So let's say that the first permission can and the next one can't enter so the user cannot browse into the page because it always takes the last permission only. You should exit the loop once you find an authorized permission to fix this bug.

mohamadcheaib
Автор

hi, i really enjoyed your tutorials. and there is vuex-persiststate . which keeps the data even if you hard reset the browser/ page . this will somehow handles the burden of hitting me everytime :D and one questions if i have multiple permissions for one page/component .do i have to write all of them inside permission array ? and what about dynamic permissions . later i changed my mind and from backend i changed that only admin can view that page not developer ? do we need to change it manually from meta:permissions ?

anygames
Автор

Did Peter commit today's work?




Yes.

kmata
Автор

suppose if i create a product component inside dashboard & i'm not giving the permission to see those products to a specific still the user can see products via postman....still he can access the can i solve the problem ??

shawonhossain