added STANDARD admin responsibility

This commit is contained in:
Laurin
2022-06-06 18:34:59 +02:00
parent 339ecff938
commit 60100273fb
10 changed files with 92 additions and 43 deletions
+2 -1
View File
@@ -85,7 +85,8 @@ export const _requireTeamleaderAuthentication =
export const requireTeamleaderAuthentication = _requireTeamleaderAuthentication({ optional: false, controlled: false });
export function requireLeaderOfTeam(auth: TeamleaderJWTPayload | undefined, teamPid: string) {
export async function requireLeaderOfTeam(auth: TeamleaderJWTPayload | undefined, teamPid: string) {
await checkTeamExistence(teamPid);
if (auth?.team !== teamPid) {
throw new AuthError("The provided authorization is not valid for the requested team");
}