It looks like you're new here. If you want to get involved, click one of these buttons!
To check if the currently logged-in user has a certain permission for at least one junction, you can use:
Gdn::session()->checkPermission('Vanilla.Discussions.Add', true, 'Category', 'any');.
However, this only returns the result for the currently logged-in user. I would like to do the same thing for a specific user object/ID instead.
There's a UserModel method
Gdn::userModel()->checkPermission($User, $Permission, $Options) (view on GitHub), but junction permission checking hasn't been implemented in this method yet as of Vanilla 2.2.1 (and 2.3b1) and noted with the line
// TODO: Check for junction table permissions.
Is there another method already written within Vanilla 2.2.1 to do this?