GravityKit\GravityCalendar\Abilities\Support\EventAccess
Applies to the event abilities the limits the calendar's own event requests get from their nonce.
The nonce is made when the calendar is rendered, and for a calendar in a GravityView View it is bound to that View, whose entry filtering then applies. Someone admitted only through the calendar's edit roles therefore names a View that shows the calendar and reaches only the events it shows them. A calendar in no View they can use is refused, secured or not: a secret is not proof that a page shows the calendar. Settings-screen users reach the whole calendar, as its settings screen preview does.
Since: TBD
Source: includes/abilities/Support/EventAccess.php:29
Details
- Kind:
class - Namespace:
GravityKit\GravityCalendar\Abilities\Support
Methods
| Method | Description |
|---|---|
view_limit() | The View to limit events to, 0 for none, or why the caller may not reach this calendar's events. |
user_can_read_view() | Whether the current user may know a View exists: it is published, or they may read it. |
views_showing() | The Views that show a calendar in a Calendar widget, in id order. |
input_properties() | The view_id input both event abilities take. |
Method Reference
view_limit()
public static function view_limit( array $feed, array $input )
The View to limit events to, 0 for none, or why the caller may not reach this calendar's events.
view_idsent: it must be a View that shows this calendar, and one the user may read. A View they may not read is refused like a View that does not exist, and never listed.- Edit-role caller, calendar shown in a View:
view_idis required. - Edit-role caller, calendar in no View they can use: refused.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$feed | array | The calendar feed. | |
$input | array | Ability input; view_id is read. |
Returns
int| WP_Error
Since: TBD
Source: includes/abilities/Support/EventAccess.php:46
user_can_read_view()
public static function user_can_read_view( int $view_id ): bool
Whether the current user may know a View exists: it is published, or they may read it.
A draft or private View that shows a calendar is not the caller's to learn about, so it is left out of every list and refused like a View that does not exist.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$view_id | int | The View. |
Returns
bool
Since: TBD
Source: includes/abilities/Support/EventAccess.php:100
views_showing()
public static function views_showing( int $feed_id ): array
The Views that show a calendar in a Calendar widget, in id order.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$feed_id | int | The calendar id. |
Returns
int[]
Since: TBD
Source: includes/abilities/Support/EventAccess.php:115
input_properties()
public static function input_properties(): array
The view_id input both event abilities take.
Returns
array<string,— array>
Since: TBD
Source: includes/abilities/Support/EventAccess.php:167