Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/overseerr/commit/caacfa21d94fd4d676bd6e3577f6b903875921c9
You should set ROOT_URL correctly, otherwise the web may not work correctly.
4 changed files with
24 additions and
5 deletions
@ -308,7 +308,9 @@ issueRoutes.post<{ issueId: string }, Issue, { message: string }>(
issueRoutes . post < { issueId : string ; status : string } , Issue > (
'/:issueId/:status' ,
isAuthenticated ( Permission . MANAGE_ISSUES ) ,
isAuthenticated ( [ Permission . MANAGE_ISSUES , Permission . CREATE_ISSUES ] , {
type : 'or' ,
} ) ,
async ( req , res , next ) = > {
const issueRepository = getRepository ( Issue ) ;
// Satisfy typescript here. User is set, we assure you!
@ -321,6 +323,16 @@ issueRoutes.post<{ issueId: string; status: string }, Issue>(
where : { id : Number ( req . params . issueId ) } ,
} ) ;
if (
! req . user ? . hasPermission ( Permission . MANAGE_ISSUES ) &&
issue . createdBy . id !== req . user ? . id
) {
return next ( {
status : 401 ,
message : 'You do not have permission to modify this issue.' ,
} ) ;
}
let newStatus : IssueStatus | undefined ;
switch ( req . params . status ) {
@ -4,6 +4,7 @@ import { MediaType } from '@server/constants/media';
import { getRepository } from '@server/datasource' ;
import IssueComment from '@server/entity/IssueComment' ;
import Media from '@server/entity/Media' ;
import { User } from '@server/entity/User' ;
import notificationManager , { Notification } from '@server/lib/notifications' ;
import { Permission } from '@server/lib/permissions' ;
import logger from '@server/logger' ;
@ -32,6 +33,10 @@ export class IssueCommentSubscriber
} )
) . issue ;
const createdBy = await getRepository ( User ) . findOneOrFail ( {
where : { id : issue.createdBy.id } ,
} ) ;
const media = await getRepository ( Media ) . findOneOrFail ( {
where : { id : issue.media.id } ,
} ) ;
@ -71,9 +76,9 @@ export class IssueCommentSubscriber
notifyAdmin : true ,
notifySystem : true ,
notifyUser :
! issue. createdBy. hasPermission ( Permission . MANAGE_ISSUES ) &&
issue. createdBy. id !== entity . user . id
? issue. createdBy
! createdBy. hasPermission ( Permission . MANAGE_ISSUES ) &&
createdBy. id !== entity . user . id
? createdBy
: undefined ,
} ) ;
}
@ -87,6 +87,7 @@ export class IssueSubscriber implements EntitySubscriberInterface<Issue> {
notifySystem : true ,
notifyUser :
! entity . createdBy . hasPermission ( Permission . MANAGE_ISSUES ) &&
entity . modifiedBy ? . id !== entity . createdBy . id &&
( type === Notification . ISSUE_RESOLVED ||
type === Notification . ISSUE_REOPENED )
? entity . createdBy
@ -475,7 +475,8 @@ const IssueDetails = () => {
className = "h-20"
/ >
< div className = "mt-4 flex items-center justify-end space-x-2" >
{ hasPermission ( Permission . MANAGE_ISSUES ) && (
{ ( hasPermission ( Permission . MANAGE_ISSUES ) ||
belongsToUser ) && (
< >
{ issueData . status === IssueStatus . OPEN ? (
< Button