lib/conjur/command/roles.rb in conjur-cli-5.3.0 vs lib/conjur/command/roles.rb in conjur-cli-5.4.0

- old
+ new

@@ -24,19 +24,21 @@ desc "Manage roles" command :role do |role| - role.desc "Create a new role" + role.desc "Create a new role [DEPRECATED]" role.arg_name "ROLE" role.command :create do |c| acting_as_option(c) c.desc "Output a JSON response with a single field, roleid" c.switch "json" c.action do |global_options,options,args| + notify_deprecated + id = require_arg(args, 'ROLE') role = api.role(id) if ownerid = options.delete(:ownerid) options[:acting_as] = ownerid @@ -100,17 +102,19 @@ role = args.shift || api.user(api.username).roleid display_members api.role(role).members, options end end - role.desc "Grant a role to another role. You must have admin permission on the granting role." + role.desc "Grant a role to another role. You must have admin permission on the granting role. [DEPRECATED]" role.arg_name "ROLE-1 ROLE-2" role.command :grant_to do |c| c.desc "Whether to grant with admin option" c.switch [:a,:admin] c.action do |global_options,options,args| + notify_deprecated + id = require_arg(args, 'ROLE-1') member = require_arg(args, 'ROLE-2') role = api.role(id) grant_options = {} grant_options[:admin_option] = true if options[:admin] @@ -118,13 +122,15 @@ puts "Role granted" end end - role.desc "Revoke a role from another role. You must have admin permission on the revoking role." + role.desc "Revoke a role from another role. You must have admin permission on the revoking role. [DEPRECATED]" role.arg_name "ROLE-1 ROLE-2" role.command :revoke_from do |c| c.action do |global_options,options,args| + notify_deprecated + id = require_arg(args, 'ROLE-1') member = require_arg(args, 'ROLE-2') role = api.role(id) role.revoke_from member puts "Role revoked"