xdmod
xdmod copied to clipboard
Refactor REST API token authentication code to allow for use of existing role-based authorization code.
Description
This refactors the authenticateToken()
method in classes/Rest/Controllers/BaseControllerProvider.php
so that it sets _USER
property of the $request
object rather than returning the $user
object. This allows for the authorize($request, $requirements)
method to be subsequently called.
Motivation and Context
Tests performed
Checklist:
- [ ] The pull request description is suitable for a Changelog entry
- [ ] The milestone is set correctly on the pull request
- [ ] The appropriate labels have been added to the pull request