Skip to content

Commit bbe4ec2

Browse files
committed
Rework permissions
1 parent 64c8fa9 commit bbe4ec2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

inc/class-client.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,13 @@ public static function register_type() {
445445
'public' => false,
446446
'hierarchical' => true,
447447
'capability_type' => array(
448-
'client',
449-
'clients',
448+
'oauth2_client',
449+
'oauth2_clients',
450+
),
451+
'capabilities' => array(
452+
'edit_posts' => 'edit_users',
453+
'edit_others_posts' => 'edit_users',
454+
'publish_posts' => 'edit_users',
450455
),
451456
'supports' => array(
452457
'title',

plugin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function bootstrap() {
1717
load();
1818

1919
// Core authentication hooks.
20+
add_action( 'init', __NAMESPACE__ . '\\Client::register_type' );
2021
add_filter( 'determine_current_user', __NAMESPACE__ . '\\Authentication\\attempt_authentication', 11 );
2122

2223
// REST API integration.

0 commit comments

Comments
 (0)