mirror of https://gitee.com/answerdev/answer.git
Merge branch 'feat/0.5.0/timeline_ai' of git.backyard.segmentfault.com:opensource/answer into feat/0.5.0/timeline_ai
This commit is contained in:
commit
01537f630e
|
@ -110,7 +110,7 @@ func (cc *CommentController) UpdateComment(ctx *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
req.UserID = middleware.GetLoginUserIDFromContext(ctx)
|
req.UserID = middleware.GetLoginUserIDFromContext(ctx)
|
||||||
can, err := cc.rankService.CheckOperationPermission(ctx, req.UserID, rank.CommentEditRank, req.UserID)
|
can, err := cc.rankService.CheckOperationPermission(ctx, req.UserID, rank.CommentEditRank, req.CommentID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
handler.HandleResponse(ctx, err, nil)
|
handler.HandleResponse(ctx, err, nil)
|
||||||
return
|
return
|
||||||
|
|
|
@ -38,6 +38,7 @@ func GetCommentPermission(ctx context.Context, userID string, creatorUserID stri
|
||||||
// GetTagPermission get tag permission
|
// GetTagPermission get tag permission
|
||||||
func GetTagPermission(ctx context.Context, canEdit, canDelete bool) (
|
func GetTagPermission(ctx context.Context, canEdit, canDelete bool) (
|
||||||
actions []*schema.PermissionMemberAction) {
|
actions []*schema.PermissionMemberAction) {
|
||||||
|
actions = make([]*schema.PermissionMemberAction, 0)
|
||||||
if canEdit {
|
if canEdit {
|
||||||
actions = append(actions, &schema.PermissionMemberAction{
|
actions = append(actions, &schema.PermissionMemberAction{
|
||||||
Action: "edit",
|
Action: "edit",
|
||||||
|
|
Loading…
Reference in New Issue