#Permissions and View Rights

4 messages · Page 1 of 1 (latest)

silver marsh
#

Hi,

I'm working on a app that needs proper permission and view / action rights. So I wanted to gain some intel. I'm sort of aware of things like Gates and Laravel-permissions (that works ontop of gates). Only I have a couple detailed questions regarding this, that I also might answer myself, but would like confirmation/feedback.

Permissions / Roles
As far as I'm aware I can use one of the great packages out there. Things like spatie their permissions package or Ladder. This will take care of the permissions on user permissions.

  • Could I be blocking routes off with this?
  • Is there a nice way to block certain actions of a page?

View rights
Hooking into to my question "block certain actions of a page" I also want to visually things, that I want to nicely remove / block. For example you are on a overview of all videos.

Not all the video are yours, when it is yours I want to show a edit-pencil and you can edit the video details. Same for delete. When it is not your video you cannot.

  • How can I cleanly block this in de server code?
  • How can I achieve this in the view?
neon nimbus
silver marsh
#

I want to have somethint to check if you are the creator of the post. Or not. And more of this stuff. Is that than all @if statements in the blade?