Skip to content

User has permission "configure navs" but cannot view navs #14774

@wackget

Description

@wackget

Bug description

User has role of "editor" which includes the "configure navs" permission. This should give them the ability to view navs, but it doesn't.

$ cat resources/users/roles.yaml
editor:
  title: Editor
  permissions:
    - 'access cp'
    - 'configure collections'
    - 'configure navs'
    - 'configure globals'
    - 'configure taxonomies'
    - 'configure asset containers'
    - 'configure forms'
    - 'access cache utility'
    - 'access search utility'
$ php please tinker
> $user = \Statamic\Facades\User::findByEmail('user@example.com');

= Statamic\Auth\File\User {#1234}

> $user->permissions()->all();

= [
    "access cp",
    "configure collections",
    "configure navs",
    "configure globals",
    "configure taxonomies",
    "configure asset containers",
    "configure forms",
    "access cache utility",
    "access search utility",
  ]

> $user->roles()->pluck('handle');

= Illuminate\Support\Collection {#2345
    all: [
      "editor",
    ],
  }

> $user->can('view navs');

= false

> $user->can('configure navs');

= true

How to reproduce

Create user with role of "Editor" using the yaml above.

Try to view a nav or run the tinker commands above.

Logs

Environment

Environment
Laravel Version: 13.8.0
PHP Version: 8.5.5
Composer Version: 2.9.7
Environment: local
Debug Mode: ENABLED
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Storage
public/storage: NOT LINKED

Livewire
Livewire: v4.3.0

Statamic
Addons: 2
License Key: Set
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 6.16.0 PRO

Statamic Addons
marcorieser/statamic-live-search: 3.2.0
marcorieser/statamic-livewire: 5.3.1

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions