artesaos / defender

Roles & Permissions for Laravel
MIT License
440 stars 97 forks source link

Priority in permissions #105

Open Minotti opened 7 years ago

Minotti commented 7 years ago

Hello guys, I believe the defender is not obeying the hierarchy of permissions.

Look:

In Defender, there are 2 kind of permissions: User permissions and Role permissions By default, the permissions que the user inherits, are permissions of the roles That It belongs to However, always que the user pemission is set, it will take.. precedence of role permission.

$ User-> attachPermission ($ permission [          'Value' => true // true = has the permission, false = does not have the permission, ]);

But this is not happening.

Look my tables: defender

Logged into user 14: dd(Defender::hasPermission('permission')); //output: true

What am I doing wrong?

wemersonjanuario commented 7 years ago

I have the same issue.

wemersonjanuario commented 7 years ago

Any workaround for this?