- Issue created by @m.stenta
- πΊπΈUnited States m.stenta
refactor
simple_oauth
to use access policies instead ofRoleStorage::isPermissionInRoles()
The maintainers of
simple_oauth
may already be thinking ahead to using access policies, so we should coordinate with them to see if there are any plans developing already. We may also have to live with a patch or override for a bit, if they need to support Drupal 10.2 or earlier (before access policies were implemented).Maybe the first place to look is
\Drupal\simple_oauth\Authentication\TokenAuthUser::hasPermission()
, which ultimately delegates down to\Drupal\simple_oauth\Oauth2ScopeProvider::scopeHasPermission()
, which is where the module is currently checkingRoleStorage::isPermissionInRoles()
. - πΊπΈUnited States m.stenta
However, in the process of testing ahead of the farmOS 3.3.0 release (which include these updates), we discovered that managed role permissions were not being applied in OAuth2 API requests
We also need to add some basic tests of the farmOS API using OAuth2. Our current tests did not catch this issue. This would be a good time to add those tests.
- πΊπΈUnited States m.stenta
For what it's worth, I also opened a core issue suggesting that
RoleStorage::isPermissionInRoles()
be deprecated: π Deprecate RoleStorage::isPermissionInRoles() Active