Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

cyprous's avatar

Roles gradation

Hi,

I made myself somewhat familiar with both spatie an bouncer packages for roles and permissions.

I am wondering though, how to approach about gradation of roles.

Imagine this structure of a blog:

  • writer can create / edit / delete his own article only (rank: 1)
  • proofreader can edit / delete other writers articles and create / edit / delete his own articles (rank: 2)
  • admin can create/ edit / delete anybodys articles (rank: 3)

Does spaties or bouncer comes with something to match the ranking out of the box? If not, could you point me to some videos / other material I could use to make it work please?

0 likes
4 replies
cyprous's avatar

This is more about user types not query scopes

jlrdw's avatar

When I looked over spatie examples, it's usually handled with strategic if statements and many times the if statement uses and or or as needed.

Edit: as you probably already know RBAC can be a time consuming and one of the trickiest things to workout in an application.

Which is one of the reasons I like checking at method level if a role matches.

Then a combination of that and query scopes can work out any query needed to let a user see their own data, or an administrator to see all.

You could always check if YouTube has more videos on spatie.

1 like

Please or to participate in this conversation.