CheckOperationObjectOwner check operation object owner
(ctx context.Context, userID, objectID string)
| 160 | |
| 161 | // CheckOperationObjectOwner check operation object owner |
| 162 | func (rs *RankService) CheckOperationObjectOwner(ctx context.Context, userID, objectID string) bool { |
| 163 | objectID = uid.DeShortID(objectID) |
| 164 | objectInfo, err := rs.objectInfoService.GetInfo(ctx, objectID) |
| 165 | if err != nil { |
| 166 | log.Error(err) |
| 167 | return false |
| 168 | } |
| 169 | // if the user is this object creator, the user can operate this object. |
| 170 | if objectInfo != nil && |
| 171 | objectInfo.ObjectCreatorUserID == userID { |
| 172 | return true |
| 173 | } |
| 174 | return false |
| 175 | } |
| 176 | |
| 177 | // CheckVotePermission verify that the user has vote permission |
| 178 | func (rs *RankService) CheckVotePermission(ctx context.Context, userID, objectID string, voteUp bool) ( |
no test coverage detected