pingpong-labs / admin

Laravel 5 Admin
https://packagist.org/packages/pingpong/admin
BSD 3-Clause "New" or "Revised" License
433 stars 114 forks source link

Role Permission Fix #16

Closed noxify closed 9 years ago

noxify commented 9 years ago

Fixes the problem that permissions are not saved, when the role had no other permissions.

gravitano commented 9 years ago

I think I have been fixed this issue. But currently I'm not working on master branch. If you look this file on develop branch in this link I have been added the if statement to check user permission before we update the user permissions.

noxify commented 9 years ago

Hi,

my pull request fixes the problem, that you can't add a permission to role if the role has no other permissions.

Your condition (same in develop and master) will only save the permission update if there are one or more permissions attached.

Example:

Role: Administrator has by default some permissions (like manage_articles etc.) and the count() will return a value > 0.

But if you create a new role, there are no permissions attached. If you now try to add a new permission (via update), the selected permission(s) will not be added.

coveralls commented 8 years ago

Coverage Status

Changes Unknown when pulling c9c98adf5c3ee3696ecb1d95d018c65ecf5ea835 on noxify:master into \ on pingpong-labs:master**.