Silvanite / novatoolpermissions

Laravel Nova Permissions Tool (User, Roles and Permissions / Access Control (ACL))
MIT License
101 stars 33 forks source link

Disable default policies #58

Open mucyomiller opened 4 years ago

mucyomiller commented 4 years ago

I don't see a way to disable or changes these default policies registered, for instance, I have defined my own in App\Providers\AutheServiceProvider likes this
Screenshot from 2020-06-23 12-32-12 but with this one defined in novatoolpermissions I do see a way to disable the one I don't want to use

 private function defineGates()
    {
        collect([
            'assignRoles',
            'manageRoles',
            'manageUsers',
            'viewRoles',
            'viewUsers',
            'viewNova',
            'canBeGivenAccess',
        ])->each(function ($permission) {
            Gate::define($permission, function ($user) use ($permission) {
                if ($this->nobodyHasAccess($permission)) {
                    return true;
                }

                return $user->hasRoleWithPermission($permission);
            });
        });
    }

I got duplicates Manage Users, View Users I want the best way to disable these default one's without changing it into the vendor folder

Screenshot from 2020-06-23 12-35-19