entity id, not the object

This commit is contained in:
Jacson Passold 2018-01-29 16:21:15 -02:00
parent 1b54969c4d
commit c251618100
1 changed files with 4 additions and 4 deletions

View File

@ -406,7 +406,7 @@ abstract class Repository {
if($post_type === false || $entity instanceof Entities\Entity ) { // There is no post
return user_can($user, 'edit_posts');
}
return user_can($user, $entity->cap->edit_post, $entity);
return user_can($user, $entity->cap->edit_post, $entity->get_id());
}
/**
@ -432,7 +432,7 @@ abstract class Repository {
return user_can($user, 'read');
}
return user_can($user, $entity->cap->read_post, $entity);
return user_can($user, $entity->cap->read_post, $entity->get_id());
}
/**
@ -457,7 +457,7 @@ abstract class Repository {
return user_can($user, 'delete_posts');
}
return user_can($user, $entity->cap->delete_post, $entity);
return user_can($user, $entity->cap->delete_post, $entity->get_id());
}
/**
@ -481,7 +481,7 @@ abstract class Repository {
if($post_type === false || $entity instanceof Entities\Entity ) { // There is no post
return user_can($user, 'publish_posts');
}
return user_can($user, $entity->cap->publish_posts, $entity);
return user_can($user, $entity->cap->publish_posts, $entity->get_id());
}
}