PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.8
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.8
1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 0.8.7 0.8.6 All 33 releases
desktop-mode / includes / framework / app / contracts / interface-auth.php

interface-auth.php in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 1.1.8, at includes/framework/app/contracts/interface-auth.php

48 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * OpenStation App Framework — Auth contract.
4 *
5 * Who is asking. The WordPress adapter answers from the current user;
6 * the standalone adapter answers from whatever the host injected.
7 *
8 * @package OpenStation
9 */
10
11 namespace OpenStation\App\Contracts;
12
13 // Direct access, unless a standalone host is booting on bare PHP.
14 if ( ! defined( 'ABSPATH' ) ) {
15 defined( 'OPENSTATION_STANDALONE' ) || exit;
16 }
17
18 interface Auth {
19
20 /**
21 * Numeric id of the acting user, 0 when anonymous.
22 *
23 * @return int
24 */
25 public function user_id();
26
27 /**
28 * Whether the acting user is authenticated at all.
29 *
30 * @return bool
31 */
32 public function is_logged_in();
33
34 /**
35 * Whether the acting user holds a capability.
36 *
37 * Extra arguments address a meta-capability's object — the id in
38 * `can( 'delete_post', $post_id )`. The WordPress adapter forwards
39 * them to `current_user_can()`; the standalone adapter answers
40 * from the capability name alone.
41 *
42 * @param string $capability Capability slug, e.g. `manage_options`.
43 * @param mixed ...$args Object the capability is asked against.
44 * @return bool
45 */
46 public function can( $capability, ...$args );
47 }
48