Sha256: ac59453b83c7be49de127af0cb5b480293629778078d875a8851f71b5d69b206
Contents?: true
Size: 659 Bytes
Versions: 27
Compression:
Stored size: 659 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.to_resource_h end def create @organization.save_and_notify! render json: @organization.to_resource_h end def update @organization.update_and_notify! organization_params render json: @organization.to_resource_h end end end
Version data entries
27 entries across 27 versions & 1 rubygems