Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what diffrent between Gate and hasTeamPermission? #278

Closed
youyi1314 opened this issue Sep 28, 2020 · 1 comment
Closed

what diffrent between Gate and hasTeamPermission? #278

youyi1314 opened this issue Sep 28, 2020 · 1 comment

Comments

@youyi1314
Copy link

youyi1314 commented Sep 28, 2020

  • Jetstream Version: ^1.1
  • Jetstream Stack: Inertia / Livewire
  • Laravel Version: ^8.0
  • PHP Version: 7.3
  • Database Driver & Version: Mysql 5.7.31

Description:

what diffrent between Gate::check('add_team_member', Team::find(1)) and User::find(1)->hasTeamPermission('add_team_member', Team::find(1))
because in blade i use Gate::check('add_team_member', Team::find(1)) it show false, but use User::find(1)->hasTeamPermission('add_team_member', Team::find(1)) it show true
and try inside php artisan tinker also

Below is my JetstreamServiceProvider
image

below is my teams table:
image

below is my users table:
image

below is my tinker result:
image

Steps To Reproduce:

edit JetstreamServiceProvider
image

edit app/Actions/Fortify/CreateNewUser.php
image

php artisan optimize
composer dumpautoload
php artisan migrate:reset (and re create new user and teams with owner)

register new user
than go to Edit Team Settings
and this is my Team Settings Page
image
cant delete, add team member there.

@driesvints
Copy link
Member

Hi there,

Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:

However, this issue will not be locked and everyone is still free to discuss solutions to your problem!

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants