[PR #4051] [MERGED] User Roles API Endpoint #6297

Closed
opened 2026-02-05 10:28:47 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/4051
Author: @ssddanbrown
Created: 2/18/2023
Status: Merged
Merged: 2/19/2023
Merged by: @ssddanbrown

Base: developmentHead: roles_api


📝 Commits (6)

  • 55456a5 Added tests for not-yet-built role API endpoints
  • 723f108 Aded roles API controller methods
  • 3c3c2ae Set order to role permissions API response
  • 9502f34 Updated test to have reliable check ordering
  • 950c02e Added role API responses & requests
  • 4176b59 Fixed unselectable checkbox role form options

📊 Changes

21 files changed (+580 additions, -54 deletions)

View changed files

📝 app/Auth/Permissions/PermissionsRepo.php (+27 -27)
📝 app/Auth/Permissions/RolePermission.php (+2 -0)
📝 app/Auth/Role.php (+5 -1)
📝 app/Auth/User.php (+1 -1)
📝 app/Http/Controllers/Api/ApiController.php (+8 -3)
app/Http/Controllers/Api/RoleApiController.php (+136 -0)
📝 app/Http/Controllers/Api/UserApiController.php (+2 -2)
📝 app/Http/Controllers/RoleController.php (+15 -11)
dev/api/requests/roles-create.json (+11 -0)
dev/api/requests/roles-update.json (+14 -0)
dev/api/responses/roles-create.json (+15 -0)
dev/api/responses/roles-list.json (+41 -0)
dev/api/responses/roles-read.json (+23 -0)
dev/api/responses/roles-update.json (+26 -0)
📝 lang/en/activities.php (+5 -0)
📝 lang/en/settings.php (+0 -3)
📝 routes/api.php (+8 -1)
tests/Api/RolesApiTest.php (+236 -0)
📝 tests/Api/UsersApiTest.php (+3 -3)
📝 tests/Helpers/UserRoleProvider.php (+1 -1)

...and 1 more files

📄 Description

Build of roles API endpoint.

For #4034, somewhat a requirement for #2702.

Todo

  • API functionality
  • Testing additions
    • Testing passing
  • Manually inspect endpoint results
  • Manually stress test manual non-api route actions.
    • Ensure notification success messages still show.
  • Example Requests/Responses
  • Read through & check API docs

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/4051 **Author:** [@ssddanbrown](https://github.com/ssddanbrown) **Created:** 2/18/2023 **Status:** ✅ Merged **Merged:** 2/19/2023 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `development` ← **Head:** `roles_api` --- ### 📝 Commits (6) - [`55456a5`](https://github.com/BookStackApp/BookStack/commit/55456a57d62ff6500e48de73ba43e0e2bcbcc056) Added tests for not-yet-built role API endpoints - [`723f108`](https://github.com/BookStackApp/BookStack/commit/723f108bd9b7f53ab90ff113d1a3ecb6958db801) Aded roles API controller methods - [`3c3c2ae`](https://github.com/BookStackApp/BookStack/commit/3c3c2ae9b59cd3e6adfc7b86acb6fb9b9d32ba1c) Set order to role permissions API response - [`9502f34`](https://github.com/BookStackApp/BookStack/commit/9502f349a282b8966ad6e5277680a64d85238028) Updated test to have reliable check ordering - [`950c02e`](https://github.com/BookStackApp/BookStack/commit/950c02e996bcd5a142038fbeb2fc7db92f887b09) Added role API responses & requests - [`4176b59`](https://github.com/BookStackApp/BookStack/commit/4176b598ce8c61b284bcdbb1cb0c05b3a0951c70) Fixed unselectable checkbox role form options ### 📊 Changes **21 files changed** (+580 additions, -54 deletions) <details> <summary>View changed files</summary> 📝 `app/Auth/Permissions/PermissionsRepo.php` (+27 -27) 📝 `app/Auth/Permissions/RolePermission.php` (+2 -0) 📝 `app/Auth/Role.php` (+5 -1) 📝 `app/Auth/User.php` (+1 -1) 📝 `app/Http/Controllers/Api/ApiController.php` (+8 -3) ➕ `app/Http/Controllers/Api/RoleApiController.php` (+136 -0) 📝 `app/Http/Controllers/Api/UserApiController.php` (+2 -2) 📝 `app/Http/Controllers/RoleController.php` (+15 -11) ➕ `dev/api/requests/roles-create.json` (+11 -0) ➕ `dev/api/requests/roles-update.json` (+14 -0) ➕ `dev/api/responses/roles-create.json` (+15 -0) ➕ `dev/api/responses/roles-list.json` (+41 -0) ➕ `dev/api/responses/roles-read.json` (+23 -0) ➕ `dev/api/responses/roles-update.json` (+26 -0) 📝 `lang/en/activities.php` (+5 -0) 📝 `lang/en/settings.php` (+0 -3) 📝 `routes/api.php` (+8 -1) ➕ `tests/Api/RolesApiTest.php` (+236 -0) 📝 `tests/Api/UsersApiTest.php` (+3 -3) 📝 `tests/Helpers/UserRoleProvider.php` (+1 -1) _...and 1 more files_ </details> ### 📄 Description Build of roles API endpoint. For #4034, somewhat a requirement for #2702. ### Todo - [x] API functionality - [x] Testing additions - [x] Testing passing - [x] Manually inspect endpoint results - [x] Manually stress test manual non-api route actions. - [x] Ensure notification success messages still show. - [x] Example Requests/Responses - [x] Read through & check API docs --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:28:47 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6297