2020-02-29, 12:56 PM
Is there a plugin that would list all existing forums and state which users can view its threads, post replies, post new threads?
Or maybe someone can give me a hint what would such an SQL look like?
I have:
How would I need to handle inherited permissions?
Or maybe someone can give me a hint what would such an SQL look like?
I have:
SELECT (SELECT group_concat(a.name order by a.pid, a.fid separator ' / ')
from `my_forums` a
WHERE concat(',',f.parentlist,',') like concat('%,',a.fid, ',%')
) as Forum,
(SELECT group_concat(g.title ORDER BY g.title ASC SEPARATOR ', ')
FROM my_forumpermissions fp, my_usergroups g
WHERE fp.fid = f.fid AND g.gid = fp.gid AND (fp.canview != 0)) as CanView,
(SELECT group_concat(g.title ORDER BY g.title ASC SEPARATOR ', ')
FROM my_forumpermissions fp, my_usergroups g
WHERE fp.fid = f.fid AND g.gid = fp.gid AND (fp.canpostreplys != 0)) as CanPostReply,
(SELECT group_concat(g.title ORDER BY g.title ASC SEPARATOR ', ')
FROM my_forumpermissions fp, my_usergroups g
WHERE fp.fid = f.fid AND g.gid = fp.gid AND (fp.canpostthreads != 0)) as CanPostThreads
FROM `my_forums` f
order by 1
How would I need to handle inherited permissions?