lib/conjur/command/resources.rb in conjur-cli-2.1.9 vs lib/conjur/command/resources.rb in conjur-cli-2.2.1
- old
+ new
@@ -13,10 +13,11 @@
c.action do |global_options,options,args|
kind = require_arg(args, "kind")
id = require_arg(args, "resource-id")
resource = api.resource([ conjur_account, kind, id ].join(':'))
resource.create(options)
+ display resource.attributes
end
end
desc "Show a resource"
arg_name "kind resource-id"
@@ -46,10 +47,11 @@
kind = require_arg(args, "kind")
id = require_arg(args, "resource-id")
role = require_arg(args, "role")
privilege = require_arg(args, "privilege")
api.resource([ conjur_account, kind, id ].join(':')).permit privilege, role
+ puts "Permission granted"
end
end
desc "Revoke a privilege on a resource"
arg_name "kind resource-id role privilege"
@@ -58,10 +60,11 @@
kind = require_arg(args, "kind")
id = require_arg(args, "resource-id")
role = require_arg(args, "role")
privilege = require_arg(args, "privilege")
api.resource([ conjur_account, kind, id ].join(':')).deny privilege, role
+ puts "Permission revoked"
end
end
desc "Check whether a role has a privilege on a resource"
arg_name "kind resource-id role privilege"
@@ -82,9 +85,10 @@
c.action do |global_options,options,args|
kind = require_arg(args, "kind")
id = require_arg(args, "resource-id")
owner = require_arg(args, "owner")
api.resource([ conjur_account, kind, id ].join(':')).give_to owner
+ puts "Role granted"
end
end
desc "List roles with a specified permission on the resource"
arg_name "kind resource-id permission"