IF (a.is_admin, 'admin',
IF(FIND_IN_SET('lists', at.perms) OR FIND_IN_SET('lists', a.user_perms), 'lists', NULL))
FROM accounts AS a
INNER JOIN account_types AS at ON (at.type = a.type)
IF (a.is_admin, 'admin',
IF(FIND_IN_SET('lists', at.perms) OR FIND_IN_SET('lists', a.user_perms), 'lists', NULL))
FROM accounts AS a
INNER JOIN account_types AS at ON (at.type = a.type)