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

user:can should be a conditional #479

Closed
edalzell opened this issue Feb 25, 2021 · 0 comments · Fixed by statamic/cms#4257
Closed

user:can should be a conditional #479

edalzell opened this issue Feb 25, 2021 · 0 comments · Fixed by statamic/cms#4257

Comments

@edalzell
Copy link

Would great if you could use else with the user:can and user:cant tags.

Otherwise you get this:

{{ user:cant do="edit projects collection" }}
    {{ redirect to="{route:login}" }}
{{ /user:cant }}
{{ user:can do="edit projects collection" }}
    {{ partial:app/estimate }}
{{ /user:can }}

Whereas this would be nicer:

{{ user:cant do="edit projects collection" }}
    {{ redirect to="{route:login}" }}
{{ else }}
    {{ partial:app/estimate }}
{{ /user:cant }}
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

Successfully merging a pull request may close this issue.

2 participants