app/controllers/phcscriptcdnpro/script/licences_controller.rb in phcscriptcdnpro-11.1.1 vs app/controllers/phcscriptcdnpro/script/licences_controller.rb in phcscriptcdnpro-11.2.0
- old
+ new
@@ -1,23 +1,25 @@
require_dependency "phcscriptcdnpro/application_controller"
module Phcscriptcdnpro
class Script::LicencesController < ApplicationController
- # Filters & Security
+ # Security & Action Filters
before_action :require_user
- before_action :membership_info
+ before_action :authrocket_membership_info
+ before_action :set_paper_trail_whodunnit
before_action :set_script_licence, only: [:show, :edit, :update, :destroy]
# INDEX - Script Licences
def index
- @script_licences = Script::Licence.all
+ @script_licences = Script::Licence.where(oganization_id: membership_info.org_id)
end
# DETAILS - Script Licences
def show
@script_licences = Script::Licence.friendly.find(params[:id])
+ @versions = PaperTrail::Version.where(item_id: params[:id], item_type: 'Phcmemberspro::Directory::Category')
end
# NEW - Script Licences
def new
@script_licence = Script::Licence.new
@@ -67,10 +69,10 @@
@script_licence = Script::Licence.friendly.find(params[:id])
end
# Whitelists
def script_licence_params
- params.require(:script_licence).permit(:lcncname, :lcncdescription, :lcncdescript, :lcnccomgpl, :lcncarvlfsf, :lcncarvlosi, :lcncarvlcopyfree, :lcncarvldebian, :lcncarvlfedora, :user_id, :slug, :user_name, :membership_id, :oganization_id)
+ params.require(:script_licence).permit(:lcncname, :lcncdescription, :lcncdescript, :lcnccomgpl, :lcncarvlfsf, :lcncarvlosi, :lcncarvlcopyfree, :lcncarvldebian, :lcncarvlfedora, :slug, :user_id, :user_name, :membership_id, :oganization_id)
end
end
end