Revision acfbc458
Added by Marek Hulán about 10 years ago
app/controllers/autosign_controller.rb | ||
---|---|---|
class AutosignController < ApplicationController
|
||
before_filter :find_proxy, :setup_proxy
|
||
|
||
def index
|
||
@proxy = SmartProxy.authorized(:view_smart_proxies_autosign).find(params[:smart_proxy_id])
|
||
setup_proxy
|
||
|
||
begin
|
||
autosign = @api.autosign
|
||
rescue => e
|
||
... | ... | |
end
|
||
|
||
def new
|
||
@proxy = SmartProxy.authorized(:create_smart_proxies_autosign).find(params[:smart_proxy_id])
|
||
setup_proxy
|
||
end
|
||
|
||
def create
|
||
@proxy = SmartProxy.authorized(:create_smart_proxies_autosign).find(params[:smart_proxy_id])
|
||
setup_proxy
|
||
|
||
if @api.set_autosign(params[:id])
|
||
process_success({:success_redirect => smart_proxy_autosign_index_path(@proxy), :object_name => 'puppet autosign entry'})
|
||
else
|
||
... | ... | |
end
|
||
|
||
def destroy
|
||
@proxy = SmartProxy.authorized(:destroy_smart_proxies_autosign).find(params[:smart_proxy_id])
|
||
setup_proxy
|
||
|
||
if @api.del_autosign(params[:id])
|
||
process_success({:success_redirect => smart_proxy_autosign_index_path(@proxy), :object_name => 'puppet autosign entry'})
|
||
else
|
||
... | ... | |
|
||
private
|
||
|
||
def find_proxy
|
||
@proxy = SmartProxy.find(params[:smart_proxy_id])
|
||
end
|
||
|
||
def setup_proxy
|
||
@api = ProxyAPI::Puppetca.new({:url => @proxy.url})
|
||
end
|
Also available in: Unified diff
fixes #812 - new permissions model, user group role and nest support, role filters for better granularity
Contributions from: