def query
      # Admin users have all role privileges for all organization processes
      return ParticipatoryProcesses::OrganizationParticipatoryProcesses.new(user.organization).query if user.admin?

      ParticipatoryProcess.where(id: process_ids)
    end
def query
      # Admin users have all role privileges for all organization processes
      return ParticipatoryProcesses::OrganizationParticipatoryProcesses.new(user.organization).query if user.admin?

      ParticipatoryProcess.where(id: process_ids)
    end
Initializes the class.

 user - a User that needs to find which processes can manage
 role - (optional) a Symbol to specify the role privilege
 Finds the ParticipatoryProcesses that the given user has role privileges.
 If the special role ':any' is provided it returns all processes where
 the user has some kind of role privilege.

 Returns an ActiveRecord::Relation.