summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/jsonapi/jsonapi.module
blob: c512575305a4f9b89b089d60d0e5871065313f56 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php

/**
 * @file
 */

/**
 * Array key for denoting type-based filtering access.
 *
 * Array key for denoting access to filter among all entities of a given type,
 * regardless of whether they are published or enabled, and regardless of
 * their owner.
 *
 * @deprecated in drupal:11.3.0 and is removed from drupal:13.0.0. Use
 * \Drupal\jsonapi\JsonApiFilter::AMONG_ALL instead.
 *
 * @see https://www.drupal.org/node/3495601
 * @see hook_jsonapi_entity_filter_access()
 * @see hook_jsonapi_ENTITY_TYPE_filter_access()
 */
const JSONAPI_FILTER_AMONG_ALL = 'filter_among_all';

/**
 * Array key for denoting type-based published-only filtering access.
 *
 * Array key for denoting access to filter among all published entities of a
 * given type, regardless of their owner.
 *
 * This is used when an entity type has a "published" entity key and there's a
 * query condition for the value of that equaling 1.
 *
 * @deprecated in drupal:11.3.0 and is removed from drupal:13.0.0. Use
 * \Drupal\jsonapi\JsonApiFilter::AMONG_PUBLISHED instead.
 *
 * @see https://www.drupal.org/node/3495601
 * @see hook_jsonapi_entity_filter_access()
 * @see hook_jsonapi_ENTITY_TYPE_filter_access()
 */
const JSONAPI_FILTER_AMONG_PUBLISHED = 'filter_among_published';

/**
 * Array key for denoting type-based enabled-only filtering access.
 *
 * Array key for denoting access to filter among all enabled entities of a
 * given type, regardless of their owner.
 *
 * This is used when an entity type has a "status" entity key and there's a
 * query condition for the value of that equaling 1.
 *
 * For the User entity type, which does not have a "status" entity key, the
 * "status" field is used.
 *
 * @deprecated in drupal:11.3.0 and is removed from drupal:13.0.0. Use
 * \Drupal\jsonapi\JsonApiFilter::AMONG_ENABLED instead.
 *
 * @see https://www.drupal.org/node/3495601
 * @see hook_jsonapi_entity_filter_access()
 * @see hook_jsonapi_ENTITY_TYPE_filter_access()
 */
const JSONAPI_FILTER_AMONG_ENABLED = 'filter_among_enabled';

/**
 * Array key for denoting type-based owned-only filtering access.
 *
 * Array key for denoting access to filter among all entities of a given type,
 * regardless of whether they are published or enabled, so long as they are
 * owned by the user for whom access is being checked.
 *
 * When filtering among User entities, this is used when access is being
 * checked for an authenticated user and there's a query condition
 * limiting the result set to just that user's entity object.
 *
 * When filtering among entities of another type, this is used when all of the
 * following conditions are met:
 * - Access is being checked for an authenticated user.
 * - The entity type has an "owner" entity key.
 * - There's a filter/query condition for the value equal to the user's ID.
 *
 * @deprecated in drupal:11.3.0 and is removed from drupal:13.0.0. Use
 * \Drupal\jsonapi\JsonApiFilter::AMONG_OWN instead.
 *
 * @see https://www.drupal.org/node/3495601
 * @see hook_jsonapi_entity_filter_access()
 * @see hook_jsonapi_ENTITY_TYPE_filter_access()
 */
const JSONAPI_FILTER_AMONG_OWN = 'filter_among_own';