Skip to content

Commit

Permalink
Searcher may be owner
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoggr committed Feb 17, 2025
1 parent 4397c59 commit f7e25b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/backend/src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ pub async fn get_ref_stubs_related_to_user(
owner.username = COALESCE($2, (SELECT username FROM users WHERE id = $1)) -- Use searcher if owner_username is NULL
)
AND p_owner.level IN ('read', 'write', 'maintain', 'own') -- Owner must have at least one permission
AND p_searcher.level IN ('read', 'write', 'maintain') -- Searcher must have permissions
AND p_searcher.level IN ('read', 'write', 'maintain', 'own') -- Searcher must have permissions
AND (
ls.name ILIKE '%' || $3 || '%' -- Case-insensitive substring search
OR $3 IS NULL -- Include all if name filter is NULL
Expand Down

0 comments on commit f7e25b2

Please sign in to comment.