lib/conjur/command/roles.rb in conjur-cli-2.1.2 vs lib/conjur/command/roles.rb in conjur-cli-2.1.3
- old
+ new
@@ -28,11 +28,20 @@
desc "Lists role memberships"
arg_name "role"
command :memberships do |c|
c.action do |global_options,options,args|
- role = args.shift || api.username
- display api.role(role).all.map(&:id)
+ role = args.shift || api.user(api.username).roleid
+ display api.role(role).all.map(&:roleid)
+ end
+ end
+
+ desc "Lists all members of the role"
+ arg_name "role"
+ command :members do |c|
+ c.action do |global_options,options,args|
+ role = args.shift || api.user(api.username).roleid
+ display api.role(role).members.map(&:member).map(&:roleid)
end
end
desc "Grant a role to another role. You must have admin permission on the granting role."
arg_name "role member"