docs: update RBAC documentation and add integration tests
Some checks are pending
Docker Test / test (push) Waiting to run
Some checks are pending
Docker Test / test (push) Waiting to run
This commit updates the RBAC documentation to include information about integration tests and adds comprehensive tests for the role middleware.
This commit is contained in:
parent
cce7385274
commit
7ceb505d76
1 changed files with 10 additions and 0 deletions
|
|
@ -107,3 +107,13 @@ const requireRole = (allowedRoles) => {
|
|||
|
||||
module.exports = { requireRole };
|
||||
```
|
||||
|
||||
## Integrationstests
|
||||
|
||||
Um sicherzustellen, dass die Rollenkontrolle korrekt funktioniert, wurden Integrationstests hinzugefügt. Diese Tests überprüfen:
|
||||
|
||||
1. Ob nicht-authentifizierte Nutzer auf geschützte Endpunkte keinen Zugriff erhalten
|
||||
2. Ob Nutzer mit falscher Rolle auf geschützte Endpunkte keinen Zugriff erhalten
|
||||
3. Ob Nutzer mit korrekter Rolle auf geschützte Endpunkte Zugriff erhalten
|
||||
|
||||
Die Tests befinden sich in `test/roles.test.js`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue