Sha256: e4f0384a94bddfc6d2a08562ece010a4c23cefa3f64fcb68828ff5115c14b5d7
Contents?: true
Size: 1 KB
Versions: 10
Compression:
Stored size: 1 KB
Contents
# frozen_string_literal: true module Decidim module Admin # A class used to find the roles of the users that can manage a given # participatory process in a process admin role (that is, processs that are # not organization admins). class ProcessAdminRolesForProcess < Rectify::Query # Syntactic sugar to initialize the class and return the queried objects. # # process - a process that needs to find its process admins def self.for(process) new(process).query end # Initializes the class. # # process - a process that needs to find its process admins def initialize(process) @process = process end # Finds the UserRoles of the users that can manage the given process. # # Returns an ActiveRecord::Relation. def query ParticipatoryProcessUserRole .where(participatory_process: process, role: [:admin, :collaborator]) end private attr_reader :process end end end
Version data entries
10 entries across 10 versions & 2 rubygems