File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -167,6 +167,14 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
167167 )
168168 }
169169
170+ const permission = await getUserEntityPermissions ( sessionUserId , 'workspace' , workspaceId )
171+ if ( permission !== 'write' && permission !== 'admin' ) {
172+ return NextResponse . json (
173+ { error : 'Write or Admin access required for execution uploads' } ,
174+ { status : 403 }
175+ )
176+ }
177+
170178 const fileValidationError = validateFileType ( fileName , contentType )
171179 if ( fileValidationError ) {
172180 throw new ValidationError ( fileValidationError . message )
@@ -192,9 +200,9 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
192200 }
193201
194202 const permission = await getUserEntityPermissions ( sessionUserId , 'workspace' , workspaceId )
195- if ( permission !== 'write' && permission !== ' admin') {
203+ if ( permission !== 'admin' ) {
196204 return NextResponse . json (
197- { error : 'Write or Admin access required for workspace logo uploads' } ,
205+ { error : 'Admin access required for workspace logo uploads' } ,
198206 { status : 403 }
199207 )
200208 }
Original file line number Diff line number Diff line change @@ -331,9 +331,11 @@ export function useUploadWorkspaceFile() {
331331 } ,
332332 onError : ( error , variables ) => {
333333 logger . error ( 'Failed to upload file:' , error )
334- toast . error ( `Failed to upload "${ variables . file . name } ": ${ error . message } ` , {
335- duration : 5000 ,
336- } )
334+ if ( ! variables . skipToast ) {
335+ toast . error ( `Failed to upload "${ variables . file . name } ": ${ error . message } ` , {
336+ duration : 5000 ,
337+ } )
338+ }
337339 } ,
338340 } )
339341}
You can’t perform that action at this time.
0 commit comments