1 | <?php |
||
16 | class Capabilities { |
||
17 | |||
18 | /** |
||
19 | * The current user can see at least SOME of these entities. |
||
20 | * @param \EEM_Base $model |
||
21 | * @param string $model_context one of the return values from EEM_Base::valid_cap_contexts() |
||
22 | * @return boolean |
||
23 | */ |
||
24 | public static function current_user_has_partial_access_to( $model, $model_context = \EEM_Base::caps_read ) { |
||
38 | /** |
||
39 | * Gets an array of all the capabilities the current user is missing that affected |
||
40 | * the query |
||
41 | * |
||
42 | * @param \EEM_Base $model |
||
43 | * @param string $request_type one of the constants on WP_JSON_Server |
||
44 | * @return array |
||
45 | */ |
||
46 | public static function get_missing_permissions( $model, $request_type = \EEM_Base::caps_read ) { |
||
49 | /** |
||
50 | * Gets a string of all the capabilities the current user is missing that affected |
||
51 | * the query |
||
52 | * |
||
53 | * @param \EEM_Base $model |
||
54 | * @param string $model_context one of the return values from EEM_Base::valid_cap_contexts() |
||
55 | * @return string |
||
56 | */ |
||
57 | public static function get_missing_permissions_string( $model, $model_context = \EEM_Base::caps_read ) { |
||
60 | |||
61 | /** |
||
62 | * Takes a entity that's ready to be returned and removes fields which the user shouldn't be able to access. |
||
63 | * @param array $entity |
||
64 | * @param \EEM_Base $model |
||
65 | * @param string $request_type one of the return values from EEM_Base::valid_cap_contexts() |
||
66 | * @param Model_Version_Info $model_version_info |
||
67 | * @return array ready for converting into json |
||
68 | */ |
||
69 | public static function filter_out_inaccessible_entity_fields( $entity, $model, $request_type, $model_version_info ) { |
||
89 | } |
||
90 | |||
91 | // End of file Capabilities.php |