Hide/disable unusable UI elements when a repository is archived (#33459)

And by the way, remove some jQuery code
This commit is contained in:
wxiaoguang 2025-01-31 20:47:31 +08:00 committed by GitHub
parent 0e8738b4b6
commit 1ab5938e82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 73 additions and 72 deletions

View file

@ -930,17 +930,19 @@ func MarkConversation(ctx context.Context, comment *Comment, doer *user_model.Us
}
// CanMarkConversation Add or remove Conversation mark for a code comment permission check
// the PR writer , offfcial reviewer and poster can do it
// the PR writer , official reviewer and poster can do it
func CanMarkConversation(ctx context.Context, issue *Issue, doer *user_model.User) (permResult bool, err error) {
if doer == nil || issue == nil {
return false, fmt.Errorf("issue or doer is nil")
}
if err = issue.LoadRepo(ctx); err != nil {
return false, err
}
if issue.Repo.IsArchived {
return false, nil
}
if doer.ID != issue.PosterID {
if err = issue.LoadRepo(ctx); err != nil {
return false, err
}
p, err := access_model.GetUserRepoPermission(ctx, issue.Repo, doer)
if err != nil {
return false, err