Sha256: d7044c920d53eb3a44c8b0dd3fe9f913747a1cd4ba3fae6510c498f8285aafa5

Contents?: true

Size: 668 Bytes

Versions: 26

Compression:

Stored size: 668 Bytes

Contents

module Api
  class OrganizationsController < BaseController
    include OrganizationsControllerTemplate

    before_action :authorize_janitor!, only: [:show, :index]
    before_action :authorize_owner!, only: [:update, :create]

    def index
      render json: { organizations: Organization.accessible_as(current_user, :janitor) }
    end

    def show
      render json: @organization.as_platform_json
    end

    def create
      @organization.save_and_notify!
      render json: @organization.as_platform_json
    end

    def update
      @organization.update_and_notify! organization_params

      render json: @organization.as_platform_json
    end
  end

end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
mumuki-laboratory-5.13.0 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.12.1 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.12.0 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.11.0 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.10.4 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.10.3 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.10.2 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.10.1 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.10.0 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.9.1 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.9.0 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.8.3 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.8.1 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.8.0 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.7.0 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.6.3 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.6.2 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.6.1 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.6.0 app/controllers/api/organizations_controller.rb
mumuki-laboratory-5.5.0 app/controllers/api/organizations_controller.rb