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

Add authorization to views, widgets and filters #75

Merged
merged 1 commit into from
Feb 5, 2024
Merged

Conversation

milewski
Copy link
Member

@milewski milewski commented Feb 5, 2024

Example usage:

NovaDashboard::make()
    ->addView('Main', fn (View $view) => $view
        ->canSee(fn () => false) // On the view
        ->addWidgets([
            BounceRate::make()->canSee(fn () => false), // On a widget
        ])
        ->addFilters([
            UserType::make()->canSee(fn () => false), // On a filter
        ]),
    ),

@milewski milewski self-assigned this Feb 5, 2024
@milewski milewski linked an issue Feb 5, 2024 that may be closed by this pull request
@milewski milewski changed the title Add authorization to view / widgets and filters Add authorization to views, widgets and filters Feb 5, 2024
@milewski milewski merged commit 03b1ee3 into main Feb 5, 2024
@milewski milewski deleted the add-authorization branch February 5, 2024 08:07
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 this pull request may close these issues.

Hiding widgets based on role?
1 participant