src/Traits/HasRoleAndPermission.php
public function allowed($providedPermission, Model $entity, $owner = true, $ownerColumn = 'user_id')
    {
        if ($this->isPretendEnabled()) {
            return $this->pretend('allowed');
        }

        if ($owner === true && $entity->{$ownerColumn} == $this->id) {
            return true;
        }

        return $this->isAllowed($providedPermission, $entity);
    }
public function allowed($providedPermission, Model $entity, $owner = true, $ownerColumn = 'user_id')
    {
        if ($this->isPretendEnabled()) {
            return $this->pretend('allowed');
        }

        if ($owner === true && $entity->{$ownerColumn} == $this->id) {
            return true;
        }

        return $this->isAllowed($providedPermission, $entity);
    }
public function allowed ( $ providedPermission , Model $ entity , $ owner = true , $ ownerColumn = 'user_id' ) { if ( $ this -> isPretendEnabled ( ) ) { return $ this -> pretend ( 'allowed' ) ; } if ( $ owner === true && $ entity -> { $ ownerColumn } == $ this -> id ) { return true ; } return $ this -> isAllowed ( $ providedPermission , $ entity ) ; }
Check if the user is allowed to manipulate with entity.

@param string $providedPermission
@param Model  $entity
@param bool   $owner
@param string $ownerColumn

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