XF 2.2 Return list of users based on permission

AndrewSimm

Well-known member
I am trying to return a list of users where "submitWithoutApproval" is false. If I was return this for the visitor then it would look like this
PHP:
$visitor->hasPermission('general', 'submitWithoutApproval');
, but instead I am trying to return a list of other users using finder.

How can I query a list of users that don't have permission to submit without approval?
 
There isn't really a trivial way. At best, you'd probably have to fetch all permission combinations and then test each one to see whether it has that permission. Built up a list of the IDs that don't have that permissions and then query for users based on their permission combination ID.
 
Top Bottom