mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
Fix read only pad access with authentication
Before this commit, webaccess.checkAccess saved the authorization in user.padAuthorizations[padId] with padId being the read-only pad ID, however later stages, e.g. in PadMessageHandler, use the real pad ID for access checks. This led to authorization being denied. This commit fixes it by only storing and comparing the real pad IDs and not read-only pad IDs. This fixes test case "authn user readonly pad -> 200, ok" in src/tests/backend/specs/socketio.js.
This commit is contained in:
parent
0d33793908
commit
3c71e8983b
4 changed files with 28 additions and 19 deletions
|
@ -156,11 +156,13 @@ Called from: src/node/db/SecurityManager.js
|
|||
|
||||
Things in context:
|
||||
|
||||
1. padID - the pad the user wants to access
|
||||
1. padID - the real ID (never the read-only ID) of the pad the user wants to
|
||||
access
|
||||
2. token - the token of the author
|
||||
3. sessionCookie - the session the use has
|
||||
|
||||
This hook gets called when the access to the concrete pad is being checked. Return `false` to deny access.
|
||||
This hook gets called when the access to the concrete pad is being checked.
|
||||
Return `false` to deny access.
|
||||
|
||||
## padCreate
|
||||
Called from: src/node/db/Pad.js
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue