MCPcopy Index your code
hub / github.com/apache/answer / canViewObject

Method canViewObject

internal/schema/simple_obj_info_schema.go:77–89  ·  view source on GitHub ↗
(userID string, isAdminModerator bool)

Source from the content-addressed store, hash-verified

75}
76
77func (s *SimpleObjectInfo) canViewObject(userID string, isAdminModerator bool) bool {
78 if isAdminModerator {
79 return true
80 }
81 switch s.ObjectType {
82 case constant.QuestionObjectType:
83 return s.QuestionCreatorUserID == userID
84 case constant.AnswerObjectType, constant.CommentObjectType, constant.TagObjectType:
85 return s.ObjectCreatorUserID == userID
86 default:
87 return false
88 }
89}
90
91func (s *SimpleObjectInfo) canViewParentQuestion(userID string, isAdminModerator bool) bool {
92 if isAdminModerator {

Callers 1

CheckVisibilityMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected