mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-07-17 23:28:04 +00:00
Signed out user can get advanced information about groups
This commit is contained in:
src
@ -222,7 +222,7 @@ export class RequestHandler {
|
||||
public async postGroupIDWithAccess(name: string, minVisibility : GroupsAccessLevel) : Promise<number> {
|
||||
const groupID = await this.postGroupID(name);
|
||||
|
||||
const access = await GroupsHelper.GetAccessLevel(groupID, this.getUserId());
|
||||
const access = await GroupsHelper.GetAccessLevel(groupID, this.optionnalUserID);
|
||||
|
||||
if(access == GroupsAccessLevel.NO_ACCESS)
|
||||
this.error(404, "Specified group not found!");
|
||||
@ -369,6 +369,14 @@ export class RequestHandler {
|
||||
return this.userID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the ID of the current user (if any)
|
||||
* or 0 if the user is not signed in
|
||||
*/
|
||||
public get optionnalUserID(): number {
|
||||
return this.userID >= 1 ? this.userID : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check out whether user is signed in or not
|
||||
*/
|
||||
|
Reference in New Issue
Block a user