Laravel-permission: How to disable multi-guards functionality?

Created on 22 Oct 2018  路  3Comments  路  Source: spatie/laravel-permission

I want to use roles and permissions for both of my guards ( 'web' , 'api' ), I don't see whats the point behind multi-guards functionality!? which force me to duplicate the same roles and permissions for both of my guards ( 'web' , 'api' ).

Is there a way to disable multi-guards functionality?

enhancement question

Most helpful comment

Screen Shot 2019-03-25 at 7 34 12 PM

_Originally posted by @jjoek in https://github.com/spatie/laravel-permission/issues/910#issuecomment-476413935_

I think we deserve an option to disable this functionality if need be.

"deserve"? Seriously?

As posted already above, v1 of this package has no guard differentiation. You can use it.
But if you're offering to pay for the many hours of coding work required to finish off the v3 for everyone to benefit, reach out to me or @freekmurze and we'll work out a sponsorship deal.
Or contribute a pull request containing the code, so we can share it for everyone.

All 3 comments

Not with v2.
However, with v1 of this package, there is no differentiation between guards. I use v1 in a few projects for this reason.
But keep in mind that v1 also ties directly with a User model, not polymorphically to multiple models.

Also, v3 aims to be guard-agnostic, but also retain the polymorphism that v2 supports. There's no ETA set yet for v3 release.

I am using the latest version as of the time of this writing.

Basically I have a laravue project and now, it is nagging, since there are instances where I want to access the roles via the api guard and other instances via web guard since the app is not a full spa.

could still make it spa but then again most of the time whilst testing I'll use tinker

I think we deserve an option to disable this functionality if need be.

Screen Shot 2019-03-25 at 7 34 12 PM

_Originally posted by @jjoek in https://github.com/spatie/laravel-permission/issues/910#issuecomment-476413935_

I think we deserve an option to disable this functionality if need be.

"deserve"? Seriously?

As posted already above, v1 of this package has no guard differentiation. You can use it.
But if you're offering to pay for the many hours of coding work required to finish off the v3 for everyone to benefit, reach out to me or @freekmurze and we'll work out a sponsorship deal.
Or contribute a pull request containing the code, so we can share it for everyone.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MichalKrakow picture MichalKrakow  路  4Comments

dylangeorgeharbour picture dylangeorgeharbour  路  3Comments

tripex picture tripex  路  3Comments

bbdangar picture bbdangar  路  4Comments

ergonomicus picture ergonomicus  路  3Comments