Sha256: cc2f768f767db9ac6d40d0c9cfa12b2168948d773515ef128405ec5d978c22e7
Contents?: true
Size: 931 Bytes
Versions: 11
Compression:
Stored size: 931 Bytes
Contents
module Pageflow class EditLocksController < Pageflow::ApplicationController before_action :authenticate_user! respond_to :json def create entry = Entry.find(params[:entry_id]) authorize!(:edit, entry) entry.edit_lock.acquire(current_user, edit_lock_params) entry.snapshot(creator: current_user) unless entry.feature_state('no_edit_lock_snapshot') respond_with(entry.reload.edit_lock, :location => entry_edit_lock_url(entry)) end def update entry = Entry.find(params[:entry_id]) authorize!(:edit, entry) entry.edit_lock.acquire(current_user, edit_lock_params) head :no_content end def destroy entry = Entry.find(params[:entry_id]) entry.edit_lock.release(current_user) head :no_content end protected def edit_lock_params params.permit(:edit_lock => [:force, :id]).fetch(:edit_lock, {}) end end end
Version data entries
11 entries across 11 versions & 1 rubygems