mirror of
https://github.com/detleph/server.git
synced 2026-09-06 23:44:26 +02:00
added STANDARD admin responsibility
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user