Ticket #235 (wontfix enhancement)
Centralize permissions for SQL request
- Created: 2011-01-02 22:42:06
- Reported by: François
- Assigned to: None
- Milestone: None
- Component: code
- Priority: normal
Could it be possible to centralize the rights conditions used in the SQL request ? It would be easier to modify them in mods.
With the 1.2, I added two variables in the common.php file, variable that replace the correspond code in all the requests of FluxBB :
$p_join = 'LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].')'; $p_where = '(fp.read_forum IS NULL OR fp.read_forum=1)';
I just have to modify those variables to modify the right in all the forum. By example, if I want to hide the forum 2 to all the members with less than 20 posts, I have
$p_where = '(fp.read_forum IS NULL OR fp.read_forum=1) AND (f.id != 2 OR '.$pun_user['num_posts'].' >= 20)';
Reines 2011-02-02 19:04:32
- Status changed from open to wontfix.
I don't think we'll do this - as soon as we start work on 2.0 we're going to be overhauling the database stuff anyway, and at some point moving it all into an API, so the structure will be totally different, and much easier to change how you are suggesting.