@ -1142,7 +1142,11 @@ func NewIssuePost(ctx *context.Context) {
}
}
// roleDescriptor returns the Role Descriptor for a comment in/with the given repo, poster and issue
// roleDescriptor returns the Role Descriptor for a comment in/with the given repo, poster and issue
func roleDescriptor ( ctx stdCtx . Context , repo * repo_model . Repository , poster * user_model . User , issue * issues_model . Issue ) ( issues_model . RoleDescriptor , error ) {
func roleDescriptor ( ctx stdCtx . Context , repo * repo_model . Repository , poster * user_model . User , issue * issues_model . Issue , hasOriginalAuthor bool ) ( issues_model . RoleDescriptor , error ) {
if hasOriginalAuthor {
return issues_model . RoleDescriptorNone , nil
}
perm , err := access_model . GetUserRepoPermission ( ctx , repo , poster )
perm , err := access_model . GetUserRepoPermission ( ctx , repo , poster )
if err != nil {
if err != nil {
return issues_model . RoleDescriptorNone , err
return issues_model . RoleDescriptorNone , err
@ -1444,7 +1448,7 @@ func ViewIssue(ctx *context.Context) {
// check if dependencies can be created across repositories
// check if dependencies can be created across repositories
ctx . Data [ "AllowCrossRepositoryDependencies" ] = setting . Service . AllowCrossRepositoryDependencies
ctx . Data [ "AllowCrossRepositoryDependencies" ] = setting . Service . AllowCrossRepositoryDependencies
if issue . ShowRole , err = roleDescriptor ( ctx , repo , issue . Poster , issue ); err != nil {
if issue . ShowRole , err = roleDescriptor ( ctx , repo , issue . Poster , issue , issue . HasOriginalAuthor ( ) ); err != nil {
ctx . ServerError ( "roleDescriptor" , err )
ctx . ServerError ( "roleDescriptor" , err )
return
return
}
}
@ -1483,7 +1487,7 @@ func ViewIssue(ctx *context.Context) {
continue
continue
}
}
comment . ShowRole , err = roleDescriptor ( ctx , repo , comment . Poster , issue )
comment . ShowRole , err = roleDescriptor ( ctx , repo , comment . Poster , issue , comment . HasOriginalAuthor ( ) )
if err != nil {
if err != nil {
ctx . ServerError ( "roleDescriptor" , err )
ctx . ServerError ( "roleDescriptor" , err )
return
return
@ -1582,7 +1586,7 @@ func ViewIssue(ctx *context.Context) {
continue
continue
}
}
c . ShowRole , err = roleDescriptor ( ctx , repo , c . Poster , issue )
c . ShowRole , err = roleDescriptor ( ctx , repo , c . Poster , issue , c . HasOriginalAuthor ( ) )
if err != nil {
if err != nil {
ctx . ServerError ( "roleDescriptor" , err )
ctx . ServerError ( "roleDescriptor" , err )
return
return