Project

General

Profile

« Previous | Next » 

Revision acfbc458

Added by Marek Hulán about 10 years ago

fixes #812 - new permissions model, user group role and nest support, role filters for better granularity

Contributions from:

View differences:

app/models/config_template.rb
class ConfigTemplate < ActiveRecord::Base
include Authorization
include Authorizable
include Taxonomix
audited :allow_mass_assignment => true
self.auditing_enabled = !(File.basename($0) == "rake" && ARGV.include?("db:migrate"))
......
template.is_a?(ConfigTemplate) ? template : nil
end
def enforce_permissions operation
# We get called again with the operation being set to create
return true if operation == "edit" and new_record?
return true if User.current and User.current.allowed_to?("#{operation}_templates".to_sym)
errors.add :base, (_("You do not have permission to %s this template") % operation)
false
end
def self.build_pxe_default(renderer)
if (proxies = SmartProxy.tftp_proxies).empty?
error_msg = _("No TFTP proxies defined, can't continue")

Also available in: Unified diff