@@ -1142,7 +1142,11 @@ func NewIssuePost(ctx *context.Context) {
11421142}
11431143
11441144// roleDescriptor returns the Role Descriptor for a comment in/with the given repo, poster and issue
1145- func roleDescriptor (ctx stdCtx.Context , repo * repo_model.Repository , poster * user_model.User , issue * issues_model.Issue ) (issues_model.RoleDescriptor , error ) {
1145+ func roleDescriptor (ctx stdCtx.Context , repo * repo_model.Repository , poster * user_model.User , issue * issues_model.Issue , hasOriginalAuthor bool ) (issues_model.RoleDescriptor , error ) {
1146+ if hasOriginalAuthor {
1147+ return issues_model .RoleDescriptorNone , nil
1148+ }
1149+
11461150 perm , err := access_model .GetUserRepoPermission (ctx , repo , poster )
11471151 if err != nil {
11481152 return issues_model .RoleDescriptorNone , err
@@ -1444,7 +1448,7 @@ func ViewIssue(ctx *context.Context) {
14441448 // check if dependencies can be created across repositories
14451449 ctx .Data ["AllowCrossRepositoryDependencies" ] = setting .Service .AllowCrossRepositoryDependencies
14461450
1447- if issue .ShowRole , err = roleDescriptor (ctx , repo , issue .Poster , issue ); err != nil {
1451+ if issue .ShowRole , err = roleDescriptor (ctx , repo , issue .Poster , issue , issue . HasOriginalAuthor () ); err != nil {
14481452 ctx .ServerError ("roleDescriptor" , err )
14491453 return
14501454 }
@@ -1483,7 +1487,7 @@ func ViewIssue(ctx *context.Context) {
14831487 continue
14841488 }
14851489
1486- comment .ShowRole , err = roleDescriptor (ctx , repo , comment .Poster , issue )
1490+ comment .ShowRole , err = roleDescriptor (ctx , repo , comment .Poster , issue , comment . HasOriginalAuthor () )
14871491 if err != nil {
14881492 ctx .ServerError ("roleDescriptor" , err )
14891493 return
@@ -1582,7 +1586,7 @@ func ViewIssue(ctx *context.Context) {
15821586 continue
15831587 }
15841588
1585- c .ShowRole , err = roleDescriptor (ctx , repo , c .Poster , issue )
1589+ c .ShowRole , err = roleDescriptor (ctx , repo , c .Poster , issue , c . HasOriginalAuthor () )
15861590 if err != nil {
15871591 ctx .ServerError ("roleDescriptor" , err )
15881592 return
0 commit comments