1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 15:49:44 +02:00

anon user space/categopry handling

This commit is contained in:
Harvey Kandola 2017-10-04 13:27:48 -04:00
parent 30321781c2
commit 7ce3adb65e
8 changed files with 36 additions and 38 deletions

View file

@ -76,9 +76,9 @@ 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=? AND location='space' UNION ALL
SELECT refid from permission WHERE orgid=? AND who='user' AND (whoid=? OR whoid='0') AND location='space' 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=?
AND p.location='space' AND p.action='view' AND (r.userid=? OR r.userid='0')
))
ORDER BY name`