mirror of
https://github.com/docmost/docmost.git
synced 2026-05-18 23:44:24 +08:00
single query check
This commit is contained in:
@@ -71,10 +71,10 @@ export class AuthenticationExtension implements Extension {
|
||||
}
|
||||
|
||||
// Check page-level permissions
|
||||
const { hasRestriction, canAccess, canEdit } =
|
||||
const { hasAnyRestriction, canAccess, canEdit } =
|
||||
await this.pagePermissionRepo.getUserPageAccessLevel(user.id, page.id);
|
||||
|
||||
if (hasRestriction) {
|
||||
if (hasAnyRestriction) {
|
||||
if (!canAccess) {
|
||||
this.logger.warn(
|
||||
`User ${user.id} denied page-level access to page: ${pageId}`,
|
||||
|
||||
Reference in New Issue
Block a user