src/Traits/HasRoleAndPermission.php
protected function isAllowed($providedPermission, Model $entity)
    {
        foreach ($this->getPermissions() as $permission) {
            if ($permission->model != '' && get_class($entity) == $permission->model
                && ($permission->id == $providedPermission || $permission->slug === $providedPermission)
            ) {
                return true;
            }
        }

        return false;
    }
protected function isAllowed($providedPermission, Model $entity)
    {
        foreach ($this->getPermissions() as $permission) {
            if ($permission->model != '' && get_class($entity) == $permission->model
                && ($permission->id == $providedPermission || $permission->slug === $providedPermission)
            ) {
                return true;
            }
        }

        return false;
    }
protected function isAllowed ( $ providedPermission , Model $ entity ) { foreach ( $ this -> getPermissions ( ) as $ permission ) { if ( $ permission -> model != '' && get_class ( $ entity ) == $ permission -> model && ( $ permission -> id == $ providedPermission || $ permission -> slug === $ providedPermission ) ) { return true ; } } return false ; }
Check if the user is allowed to manipulate with provided entity.

@param string $providedPermission
@param Model  $entity

@return bool
Check if the user is allowed to manipulate with provided entity .