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

ForgetCachedPermissions crashes on Attach #69

Closed
tudorradubarbu opened this issue Feb 7, 2019 · 2 comments
Closed

ForgetCachedPermissions crashes on Attach #69

tudorradubarbu opened this issue Feb 7, 2019 · 2 comments

Comments

@tudorradubarbu
Copy link

No description provided.

@tudorradubarbu tudorradubarbu changed the title ForgetCachedPermissions ForgetCachedPermissions crashes on Attach Feb 7, 2019
@tudorradubarbu
Copy link
Author

tudorradubarbu commented Feb 7, 2019

I added this grant admin all:

        Gate::before(function ($user, $ability) {
            if ($user->hasRole('Super Admin')) {
                return true;
            }
        });

If I am not a Super Admin in my application and I'm trying to attach a model to the User model for example ----> Class name must be a valid object or a string in /vyuldashev/nova-permission/src/ForgetCachedPermissions.php .
What am I doing wrong?

@tudorradubarbu
Copy link
Author

My bad,

I added something wrong when I declared the tool:

  (new \Vyuldashev\NovaPermission\NovaPermissionTool)->canSee(function ($request) {
              if($request->user()->can('user-update'))
              {
                return true;
              }
          }),

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

1 participant