Revision 999d8e3e
Added by Justin Sherrill over 8 years ago
app/views/api/v2/hosts/show.json.rabl | ||
---|---|---|
partial(definition.api_single_view, :object => @host) if definition.api_single_view
|
||
end
|
||
end
|
||
|
||
node :permissions do |host|
|
||
authorizer = Authorizer.new(User.current)
|
||
Permission.where(:resource_type => "Host").all.inject({}) do |hash, permission|
|
||
hash[permission.name] = authorizer.can?(permission.name, host)
|
||
hash
|
||
end
|
||
end
|
Also available in: Unified diff
Fixes #13639 - add host permissions to host show api