class PostPolicy (View source)

Methods

__construct(PermissionCollection $permissions)

No description

bool
create()

Any user can create a post.

bool
moderate(User $user, Post $post)

Users can moderate a post and its comments if they have permission.

bool
edit(User|null $user, Post $post)

Users can edit their own posts. Users with the moderate ability can edit any posts.

bool
delete(User $user, Post $post)

Users can delete their own posts if they're uncommented on. Users with the moderate ability can delete any posts.

bool
move(User $user, Post $post)

Users can move their own posts if they're uncommented on. Users with the moderate ability can move any posts.

bool
comment(User $user, Post $post)

Users can comment on a post if they have permission and the post is not locked.

bool
react()

Any user can react to a post.

Details

__construct(PermissionCollection $permissions)

No description

Parameters

PermissionCollection $permissions

bool create()

Any user can create a post.

Return Value

bool

bool moderate(User $user, Post $post)

Users can moderate a post and its comments if they have permission.

Parameters

User $user
Post $post

Return Value

bool

bool edit(User|null $user, Post $post)

Users can edit their own posts. Users with the moderate ability can edit any posts.

Parameters

User|null $user
Post $post

Return Value

bool

bool delete(User $user, Post $post)

Users can delete their own posts if they're uncommented on. Users with the moderate ability can delete any posts.

Parameters

User $user
Post $post

Return Value

bool

bool move(User $user, Post $post)

Users can move their own posts if they're uncommented on. Users with the moderate ability can move any posts.

Parameters

User $user
Post $post

Return Value

bool

bool comment(User $user, Post $post)

Users can comment on a post if they have permission and the post is not locked.

Parameters

User $user
Post $post

Return Value

bool

bool react()

Any user can react to a post.

Return Value

bool