mirror of
https://github.com/documize/community.git
synced 2025-07-22 22:59:43 +02:00
Ensure space view permission comes before doc permissions
This commit is contained in:
parent
c1667e97b7
commit
3993cfeb8e
5 changed files with 13 additions and 12 deletions
|
@ -77,7 +77,7 @@ func (s Scope) GetViewable(ctx domain.RequestContext) (sp []space.Space, err err
|
|||
SELECT id,refid,label as name,orgid,userid,type,created,revised FROM label
|
||||
WHERE orgid=?
|
||||
AND refid IN (SELECT refid FROM permission WHERE orgid=? AND location='space' AND refid IN (
|
||||
SELECT refid from permission WHERE orgid=? AND who='user' AND (whoid=? OR whoid='0') AND location='space' UNION ALL
|
||||
SELECT refid from permission WHERE orgid=? AND who='user' AND (whoid=? OR whoid='0') AND location='space' AND action='view' UNION ALL
|
||||
SELECT p.refid from permission p LEFT JOIN rolemember r ON p.whoid=r.roleid WHERE p.orgid=? AND p.who='role'
|
||||
AND p.location='space' AND p.action='view' AND (r.userid=? OR r.userid='0')
|
||||
))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue