mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
Feature #407: Let users see their own group information, using 'onegroup show'
This commit is contained in:
parent
6bedb99c6a
commit
d7787bc4e3
@ -96,7 +96,10 @@ void AuthRequest::add_auth(Object ob,
|
||||
// User can show and MANAGE (change passwd) their own information
|
||||
( uid == ob_id_int && ob == USER &&
|
||||
( op == INFO || op == MANAGE )
|
||||
)
|
||||
) ||
|
||||
|
||||
// Users can show their group information
|
||||
( ob == GROUP && gid == ob_id_int && op == INFO )
|
||||
)
|
||||
{
|
||||
auth = true;
|
||||
|
@ -92,8 +92,9 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
||||
Shows information for the given Group
|
||||
EOT
|
||||
|
||||
command :show, show_desc, :groupid, :options=>OpenNebulaHelper::XML do
|
||||
helper.show_resource(args[0],options)
|
||||
command :show, show_desc,[:groupid, nil], :options=>OpenNebulaHelper::XML do
|
||||
group = args[0] || OpenNebula::Group::SELF
|
||||
helper.show_resource(group,options)
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -27,6 +27,9 @@ module OpenNebula
|
||||
:delete => "group.delete"
|
||||
}
|
||||
|
||||
# Flag for requesting connected user's group info
|
||||
SELF = -1
|
||||
|
||||
# Creates a Group description with just its identifier
|
||||
# this method should be used to create plain Group objects.
|
||||
# +id+ the id of the user
|
||||
|
Loading…
x
Reference in New Issue
Block a user