File tree Expand file tree Collapse file tree 1 file changed +2
-14
lines changed
Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -89,14 +89,7 @@ export async function POST(req: NextRequest) {
8989 }
9090
9191 const userPermission = await getUserEntityPermissions ( userId , 'workspace' , workspaceId )
92- if ( ! userPermission ) {
93- logger . warn (
94- `[${ requestId } ] User ${ userId } does not have access to workspace ${ workspaceId } `
95- )
96- return NextResponse . json ( { error : 'Access denied' } , { status : 403 } )
97- }
98-
99- if ( userPermission !== 'admin' && userPermission !== 'write' ) {
92+ if ( ! userPermission || ( userPermission !== 'admin' && userPermission !== 'write' ) ) {
10093 logger . warn (
10194 `[${ requestId } ] User ${ userId } does not have write permission for workspace ${ workspaceId } `
10295 )
@@ -159,12 +152,7 @@ export async function DELETE(request: NextRequest) {
159152 }
160153
161154 const userPermission = await getUserEntityPermissions ( userId , 'workspace' , workspaceId )
162- if ( ! userPermission ) {
163- logger . warn ( `[${ requestId } ] User ${ userId } does not have access to workspace ${ workspaceId } ` )
164- return NextResponse . json ( { error : 'Access denied' } , { status : 403 } )
165- }
166-
167- if ( userPermission !== 'admin' && userPermission !== 'write' ) {
155+ if ( ! userPermission || ( userPermission !== 'admin' && userPermission !== 'write' ) ) {
168156 logger . warn (
169157 `[${ requestId } ] User ${ userId } does not have write permission for workspace ${ workspaceId } `
170158 )
You can’t perform that action at this time.
0 commit comments