lib/conjur/command/resources.rb in conjur-cli-4.10.1 vs lib/conjur/command/resources.rb in conjur-cli-4.10.3

- old
+ new

@@ -60,15 +60,22 @@ end resource.desc "Give a privilege on a resource" resource.arg_name "resource-id role privilege" resource.command :permit do |c| + c.desc "allow transfer to other roles" + c.switch [:g, :grantable] c.action do |global_options,options,args| id = full_resource_id( require_arg(args, "resource-id") ) role = require_arg(args, "role") privilege = require_arg(args, "privilege") - api.resource(id).permit privilege, role + unless options[:g] + api.resource(id).permit privilege, role + else + api.resource(id).permit privilege, role, grant_option: true + end + puts "Permission granted" end end resource.desc "Deny a privilege on a resource" @@ -171,6 +178,6 @@ c.action do |global_options, options, args| command_impl_for_list global_options, options, args end end end -end \ No newline at end of file +end