Sha256: 9acb221c703bec318ab57b6e36fe30d74cd7176a7f83134422e2b35adc870816
Contents?: true
Size: 636 Bytes
Versions: 12
Compression:
Stored size: 636 Bytes
Contents
module Api class OrganizationsController < BaseController include OrganizationsControllerTemplate before_action :authorize_janitor!, only: [:show, :index] before_action :authorize_admin!, 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! render json: @organization.to_resource_h end def update @organization.update! organization_params render json: @organization.to_resource_h end end end
Version data entries
12 entries across 12 versions & 1 rubygems