Change granularity to granularity_id in createOauthScope()

Created on 18 April 2025, 7 days ago

Problem/Motivation

Update CloudFormTrait.php and the createOauthScope method. Between drupal/simple_oauth:6.0.0-beta6 and drupal/simple_oauth:6.0.0, the name: granularity in the Oauth2Scope.php entity, changed to granularity_id .

Update from

Oauth2Scope::create([
        'id' => 'cloud_dashboard',
        'name' => 'cloud_dashboard',
        'description' => 'Cloud dashboard',
        'grant_types' => [
          'authorization_code' => [
            'status' => TRUE,
            'description' => '',
          ],
          'client_credentials' => [
            'status' => TRUE,
            'description' => '',
          ],
        ],
        'umbrella' => FALSE,
        'parent' => '_none',
        'granularity' => 'role',
        'permission' => '',
        'role' => 'cloud_admin',
        'langcode' => 'en',
      ])->save();

to

Oauth2Scope::create([
        'id' => 'cloud_dashboard',
        'name' => 'cloud_dashboard',
        'description' => 'Cloud dashboard',
        'grant_types' => [
          'authorization_code' => [
            'status' => TRUE,
            'description' => '',
          ],
          'client_credentials' => [
            'status' => TRUE,
            'description' => '',
          ],
        ],
        'umbrella' => FALSE,
        'parent' => '_none',
        'granularity' => 'role',
        'permission' => '',
        'role' => 'cloud_admin',
        'langcode' => 'en',
      ])->save();


to

      Oauth2Scope::create([
        'id' => 'cloud_dashboard',
        'name' => 'cloud_dashboard',
        'description' => 'Cloud dashboard',
        'grant_types' => [
          'authorization_code' => [
            'status' => TRUE,
            'description' => '',
          ],
          'client_credentials' => [
            'status' => TRUE,
            'description' => '',
          ],
        ],
        'umbrella' => FALSE,
        'parent' => '_none',
        'granularity_id' => 'role',
        'permission' => '',
        'granularity_configuration' => [
          'role' => 'cloud_admin',
        ],
        'langcode' => 'en',
      ])->save();

Also, recompile SPA to remove debugger declaration.

πŸ› Bug report
Status

Active

Version

8.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States baldwinlouie

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024