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

Laravel 11 Roles visible/editable always to anyone #407

Closed
core45 opened this issue Aug 1, 2024 · 2 comments
Closed

Laravel 11 Roles visible/editable always to anyone #407

core45 opened this issue Aug 1, 2024 · 2 comments

Comments

@core45
Copy link

core45 commented Aug 1, 2024

In Laravel 11 the Roles are visible and editable to anyone regardless of his rights.

What is weird the rights work perfectly well with any other model

This is my User model:

class User extends Authenticatable implements FilamentUser, MustVerifyEmail
{
    use HasFactory, Notifiable;
    use HasRoles;
    use HasPanelShield;

    public function canAccessPanel(Panel $panel): bool
    {
        return true;
    }

    public function getFilamentRoles()
    {
        return $this->roles->pluck('name');
    }
}

What do I do wrong? The Rights settings should be available only to the super_admin obviously.

@chadriae
Copy link

chadriae commented Aug 2, 2024

In the filament-shield.php config file edit this line to:
register_role_policy' => [ 'enabled' => true, ]

@core45
Copy link
Author

core45 commented Aug 6, 2024

Thank you. This should be enabled by default...

bezhanSalleh added a commit that referenced this issue Sep 2, 2024
bezhanSalleh added a commit that referenced this issue Sep 2, 2024
…auto-registration

handles role policy auto registration and resolves #407
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

3 participants