romanbican / roles

Powerful package for handling roles and permissions in Laravel 5
MIT License
1.15k stars 296 forks source link

Use canOne instead of can so we can resolve the conflicts with authorization #139

Open Ricky-rick opened 8 years ago

Ricky-rick commented 8 years ago

Call the 'canOne' function instead of the 'can' function in the Middleware and ServiceProvider so we can make us of Laravel's authorization 'can' function. Now it's posible to use the Authorizable and the HasRoleAndPermission trait in the user model

class User extends Model implements AuthenticatableContract, HasRoleAndPermissionContract
{
    use Authenticatable, HasRoleAndPermission, Authorizable {
        Authorizable::can insteadof HasRoleAndPermission;
        HasRoleAndPermission::can as hasRoleAndPermissionCan;
    }
}