mirror of
https://github.com/umami-software/umami.git
synced 2026-02-05 13:17:19 +01:00
Updated edit permissions on settings components.
This commit is contained in:
parent
ffc8f6faae
commit
7effa16f00
15 changed files with 128 additions and 148 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import { z } from 'zod';
|
||||
import { unauthorized, json, badRequest, notFound } from '@/lib/response';
|
||||
import { canCreateTeam } from '@/permissions';
|
||||
import { json, badRequest, notFound } from '@/lib/response';
|
||||
import { parseRequest } from '@/lib/request';
|
||||
import { ROLES } from '@/lib/constants';
|
||||
import { createTeamUser, findTeam, getTeamUser } from '@/queries';
|
||||
|
|
@ -16,10 +15,6 @@ export async function POST(request: Request) {
|
|||
return error();
|
||||
}
|
||||
|
||||
if (!(await canCreateTeam(auth))) {
|
||||
return unauthorized();
|
||||
}
|
||||
|
||||
const { accessCode } = body;
|
||||
|
||||
const team = await findTeam({
|
||||
|
|
@ -29,7 +24,7 @@ export async function POST(request: Request) {
|
|||
});
|
||||
|
||||
if (!team) {
|
||||
return notFound({ message: 'Team not found.' });
|
||||
return notFound({ message: 'Team not found.', code: 'team-not-found' });
|
||||
}
|
||||
|
||||
const teamUser = await getTeamUser(team.id, auth.user.id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue