MattRogowski/Custom-User-Permissions

check a user can view a forum if permission is custom

Opened this issue · 1 comments

Hi, i wrote this code to check if user uid=4 can view a forum fid = 49, canview is 0 even if i gave canview permission by your plugin:

$fpermissions = forum_permissions(49, 4);

$canview = $fpermissions['canview'];

I know I'm replying to this 4 years after it was added, but this is a limitation of how the plugin works. It loads the permissions at runtime for the logged in user only, so they have the permissions applied to them as they use the forum. It doesn't load them in while trying to "externally" check the permissions of a user, because a) that'd be very difficult/perhaps inefficient to hook into and b) any custom permission checks wouldn't be covered. Anywhere that tries to check or query the permissions of other users won't be covered by the plugin, because they'd only be checking the standard permissions, and the custom ones would never be loaded to cascade over the standard ones.