hedgedoc/backend
Tilman Vatteroth a852c79947 refactor: replace permission check methods with ordered permission enum
This commit replaces the "mayWrite", "mayRead" and "checkPermissionOnNote"
functions with one that returns a sortable permission value.
This is done because many places in the code need to do actions based on the fact if
the user has no, read or write access. If done with the may-functions then the permission
data need to be looked through multiple times.

Also, the whole check code is split into more functions that are tested separately and make it easier
to understand the process.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-19 19:10:45 +02:00
..
docker chore(deps): update node.js to 4559bc0 2023-05-17 02:21:52 +00:00
public fix(repository): Move backend code into subdirectory 2022-10-30 22:46:42 +01:00
src refactor: replace permission check methods with ordered permission enum 2023-05-19 19:10:45 +02:00
test fix: increase test coverage 2023-05-07 20:45:15 +02:00
.editorconfig fix(repository): Move backend code into subdirectory 2022-10-30 22:46:42 +01:00
.env fix: add .env file symlinks 2023-04-13 10:39:17 +02:00
.eslintrc.js build: add eslint rule forbidding TypeORM Equal constructor 2023-03-25 16:29:14 +01:00
.gitignore fix(repository): Move backend code into subdirectory 2022-10-30 22:46:42 +01:00
.prettierrc.json feat(package): adjust packages to workspaces 2022-12-04 20:59:46 +01:00
.prettierrc.json.license feat(package): adjust packages to workspaces 2022-12-04 20:59:46 +01:00
CHANGELOG.md fix(repository): Move backend code into subdirectory 2022-10-30 22:46:42 +01:00
jest-e2e.json fix(repository): Move backend code into subdirectory 2022-10-30 22:46:42 +01:00
jest-e2e.json.license fix(repository): Move backend code into subdirectory 2022-10-30 22:46:42 +01:00
nest-cli.json fix(repository): Move backend code into subdirectory 2022-10-30 22:46:42 +01:00
nest-cli.json.license fix(repository): Move backend code into subdirectory 2022-10-30 22:46:42 +01:00
package.json fix(deps): update dependency rimraf to v5.0.1 2023-05-18 03:43:38 +00:00
package.json.license fix(repository): Move backend code into subdirectory 2022-10-30 22:46:42 +01:00
tsconfig.build.json fix(repository): Move backend code into subdirectory 2022-10-30 22:46:42 +01:00
tsconfig.build.json.license fix(repository): Move backend code into subdirectory 2022-10-30 22:46:42 +01:00
tsconfig.json fix(backend): keep log output in dev mode 2023-03-28 11:34:05 +02:00
tsconfig.json.license fix(repository): Move backend code into subdirectory 2022-10-30 22:46:42 +01:00