# User:Can

Anything inside the `user:can` tag will only be rendered if the user has the specified permission.

## Overview

User tags are designed for sites that have areas or features behind a login. The `{{ user:can }}` tag is used to check if the currently logged in user has a one or more specific permissions.

## Example

Let's say we want a link to edit the current entry in the control panel if the user has the `edit faq entries` permission.

::tabs

::tab antlers
```antlers
{{ user:can do="edit faq entries" }}
    <a href="{{ edit_url }}">Edit this Page</a>
{{ /user:can }}
```
::tab blade
```blade
{{-- Using user methods --}}
@if (auth()->user()?->can('edit blog entries'))
  ...
@endif

{{-- Using Fluent Tags --}}
@if (Statamic::tag('user:can')->do('edit blog entries')->fetch())
  ...
@endif

{{-- Using Antlers Blade Components --}}
<s:user:can
  do="edit blog entries"
>
  ...
</s:user:can>
```
::

## Super Users

[Super users](/users.md#super-users) are granted permission for any Statamic-related abilities. When a permission doesn't exist in Statamic, it'll fall back to [traditional Laravel authorization](https://laravel.com/docs/master/authorization#main-content).

## Passing Arguments to Gates

When falling back to Laravel authorization, you can pass additional arguments to your gate by adding extra parameters to the tag. Any parameter besides `do`/`permission` will be forwarded to the gate in the order it's defined.

```php
Gate::define('view secret', function ($user, $secret) {
    return $user->hasAccessToSecret($secret);
});
```

```antlers
{{ user:can do="view secret" secret="foo" }}
    ...
{{ /user:can }}
```

## Can’t

We also support the negative use case using `{{ user:cant }}` tags.

::tabs

::tab antlers
```antlers
{{ user:cant do="anything" }}
  <p>Aww, I'm sure that's not true! 😊</p>
{{ /user:cant }}
```
::tab blade
```blade
{{-- Using user methods --}}
@if (auth()->user()?->cant('do anything'))
  <p>Aww, I'm sure that's not true! 😊</p>
@endif

{{-- Using Fluent Tags --}}
@if (Statamic::tag('user:cant')->do('anything')->fetch())
  <p>Aww, I'm sure that's not true! 😊</p>
@endif

{{-- Using Antlers Blade Components --}}
<s:user:cant
  do="anything"
>
  <p>Aww, I'm sure that's not true! 😊</p>
</s:user:cant>
```
::

## Permissions List

Check out the the complete [list of user permissions](/permissions.md#native-permissions).
