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

Create Team disabled on Team Policy, but teams/create route not disabled. #665

Closed
berkerbekman opened this issue Feb 7, 2021 · 8 comments · Fixed by #669
Closed

Create Team disabled on Team Policy, but teams/create route not disabled. #665

berkerbekman opened this issue Feb 7, 2021 · 8 comments · Fixed by #669
Labels

Comments

@berkerbekman
Copy link

  • Jetstream Version: Latest
  • Jetstream Stack: Livewire
  • Uses Teams: yes
  • Laravel Version: Latest
  • PHP Version: Latest
  • Database Driver & Version: sqlite

Description:

I don't want the user to create more than one team. i disabled in team policy.

public function create(User $user) { return false; }

but I can access the route. localhost/teams/create

when i press the create button, the unauthorized modal opens. the route itself needs to be unauthorized. teams/create.

Steps To Reproduce:

Ekran Resmi 2021-02-07 22 58 27

@driesvints
Copy link
Member

Enabling or disabling teams needs to be done up front when creating an app and not afterwards.

@berkerbekman
Copy link
Author

Enabling or disabling teams needs to be done up front when creating an app and not afterwards.

I didn't understand exactly what to do. Can you explain more clearly?

@driesvints
Copy link
Member

@berkerbekman when you first install Jetstream you're presented with the option to choose teams or not. If you choose teams upon install you cannot easily disable it afterwards as there's much tiny bits and pieces that can cause issues like the above. Try installing a fresh jetstream app and choose to not enable teams upon installation.

@berkerbekman
Copy link
Author

@berkerbekman when you first install Jetstream you're presented with the option to choose teams or not. If you choose teams upon install you cannot easily disable it afterwards as there's much tiny bits and pieces that can cause issues like the above. Try installing a fresh jetstream app and choose to not enable teams upon installation.

I did. but there is the same error. I think this is a bug that needs to be fixed.

laravel new project
composer require laravel/jetstream
php artisan jetstream:install livewire
php artisan jetstream:install livewire --teams

I did all the steps in order. The error is the same.

@driesvints
Copy link
Member

You ran the install step two times. One time without the teams option and one time with the teams option. You can only run it one time.

@berkerbekman
Copy link
Author

You ran the install step two times. One time without the teams option and one time with the teams option. You can only run it one time.

I tried in two ways. the result is the same.

laravel new project
composer require laravel/jetstream
php artisan jetstream:install livewire --teams
and TeamsPolicy create function true to false.
php artisan migrate
php artisan serve

Should all the steps be like this? It doesn't work that way.

@driesvints
Copy link
Member

I'm sorry, I totally misunderstood the issue. I can now see what you mean. I'll PR a fix. Thanks for reporting!

@driesvints
Copy link
Member

@berkerbekman I'll keep this open until the PR is merged

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

Successfully merging a pull request may close this issue.

2 participants