Revision 9d402d07
Added by Greg Sutcliffe almost 11 years ago
app/models/host/managed.rb | ||
---|---|---|
current = User.current
|
||
if (operation == "edit") or operation == "destroy"
|
||
if current.allowed_to?("#{operation}_hosts".to_sym)
|
||
return true if Host.my_hosts.include? self
|
||
return true if Host::Base.my_hosts.include? self
|
||
end
|
||
else # create
|
||
if current.allowed_to?(:create_hosts)
|
Also available in: Unified diff
Fixes #2501 - Allow my_hosts scope to include all subclasses of Host::Base