diff --git a/src/entities/RequestHandler.ts b/src/entities/RequestHandler.ts index cca0641..7314757 100644 --- a/src/entities/RequestHandler.ts +++ b/src/entities/RequestHandler.ts @@ -314,10 +314,10 @@ export class RequestHandler { * * @param name The name of the POST field containing the ID of the target post */ - public async postPostIDWithAccess(name: string) : Promise { + public async postPostIDWithAccess(name: string, minLevel: PostAccessLevel = PostAccessLevel.BASIC_ACCESS) : Promise { const postID = await this.postPostID(name); - if(await PostsHelper.GetAccessLevelFromPostID(this.optionnalUserID, postID) == PostAccessLevel.NO_ACCESS) + if(await PostsHelper.GetAccessLevelFromPostID(this.optionnalUserID, postID) < minLevel) this.error(401, "Your are not allowed to access this post information!"); return postID;