MCPcopy Index your code
hub / github.com/dnote/dnote / ViewNote

Function ViewNote

pkg/server/permissions/permissions.go:23–32  ·  view source on GitHub ↗

ViewNote checks if the given user can view the given note

(user *database.User, note database.Note)

Source from the content-addressed store, hash-verified

21
22// ViewNote checks if the given user can view the given note
23func ViewNote(user *database.User, note database.Note) bool {
24 if user == nil {
25 return false
26 }
27 if note.UserID == 0 {
28 return false
29 }
30
31 return note.UserID == user.ID
32}

Callers 2

GetNoteFunction · 0.92
TestViewNoteFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestViewNoteFunction · 0.68