SharePolicy
in package
implements
ResourcePolicyInterface
Uses
HasPolicyTrait, CheckPrivacyShareabilityTrait
Class SharePolicy.
Tags
Table of Contents
Interfaces
Properties
- $type : string
Methods
- __call() : bool
- create() : bool
- delete() : bool
- deleteOwn() : bool
- isPrivacyShareable() : bool
- isSavedItem() : bool
- saveItem() : bool
- share() : bool
- shareItem() : bool
- update() : bool
- view() : bool
- viewAny() : bool
- viewOnProfilePage() : bool
- viewOwner() : bool
- checkSpecialSharePermission() : bool
Properties
$type
protected
string
$type
= 'share'
Methods
__call()
public
__call(string $ability, array<string|int, mixed> $arguments) : bool
Parameters
- $ability : string
- $arguments : array<string|int, mixed>
Return values
boolcreate()
public
create(User $user[, User|null $owner = null ]) : bool
Parameters
Return values
booldelete()
public
delete(User $user[, Entity|null $resource = null ]) : bool
Parameters
Return values
booldeleteOwn()
public
deleteOwn(User $user[, Entity|null $resource = null ]) : bool
Parameters
Return values
boolisPrivacyShareable()
public
isPrivacyShareable(int|null $privacy) : bool
Parameters
- $privacy : int|null
Return values
boolisSavedItem()
public
isSavedItem(User $user, Content $resource) : bool
Parameters
Return values
boolsaveItem()
public
saveItem(User $user[, Content $resource = null ]) : bool
Parameters
Return values
boolshare()
public
share(string $entityType, User $user, mixed $resource[, mixed $newValue = null ]) : bool
Parameters
- $entityType : string
- $user : User
- $resource : mixed
- $newValue : mixed = null
Return values
boolshareItem()
public
shareItem(User $user[, User|null $owner = null ][, array<string|int, mixed>|null $attributes = [] ]) : bool
Parameters
Return values
boolupdate()
public
update(User $user[, Entity|null $resource = null ]) : bool
Parameters
Return values
boolview()
public
view(User $user, Entity $resource) : bool
Parameters
Return values
boolviewAny()
public
viewAny(User $user[, User|null $owner = null ]) : bool
Parameters
Return values
boolviewOnProfilePage()
public
viewOnProfilePage(User $user, User $owner) : bool
Parameters
Return values
boolviewOwner()
public
viewOwner(User $user[, User|null $owner = null ]) : bool
Parameters
Return values
boolcheckSpecialSharePermission()
private
checkSpecialSharePermission(Content $content) : bool
Parameters
- $content : Content