Nextcloud PHP API (master)

RestrictInteractionEvent extends Event
in package

FinalYes

This event can be emitted to check if a user is allowed to perform an action, such that the receiver would become aware of the resource.

If the resource has a distinction between an owner and a initiator, the event must be emitted for both. Emitters may omit one or multiple properties, if they are not known. Emitters must call isInteractionRestricted instead of dispatching the event manually, to ensure exception handling and audit logging is done correctly. Listeners may ignore any of the properties and only check the ones that are relevant to them. Listeners must throw an InteractionRestrictedException, if they want to restrict the interaction.

Tags
since
34.0.2
Attributes
#[Consumable]
$since: '34.0.2'

Table of Contents

Properties

$action  : InteractionAction|null
$receiver  : InteractionReceiver|null
$resource  : InteractionResource|null
$userId  : string
$user  : IUser|null

Methods

__construct()  : mixed
Compatibility constructor
getUser()  : IUser
isInteractionRestricted()  : false|string
isPropagationStopped()  : bool
{@inheritDoc}
stopPropagation()  : void
Stops the propagation of the event to further event listeners

Properties

Methods

isInteractionRestricted()

public isInteractionRestricted() : false|string
Tags
since
34.0.2
Return values
false|string

Returns a user friendly translated message if the interaction is restricted.

isPropagationStopped()

{@inheritDoc}

public isPropagationStopped() : bool
Tags
since
22.0.0
see
StoppableEventInterface
Attributes
#[Override]
Return values
bool

stopPropagation()

Stops the propagation of the event to further event listeners

public stopPropagation() : void
Tags
since
22.0.0
On this page

Search results