Skip to content

Add an enabler resolver config #1787

Open
@systemsolutionweb

Description

@systemsolutionweb

What if a resolver is created, which can be declared within the configuration file, where extra validation can be added by returning a boolean,

for example: within the resolver validate if a user is an administrator and based on that enable the debugbar, it would not appear to any other user

Is there already such an option?
Would it be a good idea to implement it to add more control?

class DebugbarEnableResolver implements Resolver
{
    public static function resolve(): bool
    {
        if (Auth::check() && Auth::user()->is_admin) {
            return true
        }
        
        // here maybe other conditions

        return false;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions