Zizaco / entrust

Role-based Permissions for Laravel 5
MIT License
6.05k stars 1.29k forks source link

Ability only validates first permission #922

Closed justijndepover closed 6 years ago

justijndepover commented 6 years ago

First of: Great plugin!

Issue

Just spend a ton of time searching for this "bug".

My blade file contained this:

@ability('', 'permission1, permission2')
<div>
    html goes here
</div>
@endability

If my user has the permission1 permission the block is rendered correctly but if my user only has the permission2 permission the block is not rendered.

It turns out the mistake I made was to put a space inside the permission list after the comma.

@ability('', 'permission1,<space>permission2')

should be

@ability('', 'permission1,permission2')

I know this is not technically an issue but it would be nice to trim the comma separated list to prevent these kind of mistakes. I'm guessing i'm not the first to encounter this problem.

justijndepover commented 6 years ago

Closing because it's not technically a bug