From 1b02cf8136c3ef1c5575dd927fc7a4ffb005633b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 7 Dec 2011 13:07:15 +0100 Subject: [PATCH] Feature #862: 'one* list g' shows by default public resources in the user's group, instead of any resource in the group --- src/rm/RequestManagerPoolInfoFilter.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/rm/RequestManagerPoolInfoFilter.cc b/src/rm/RequestManagerPoolInfoFilter.cc index 25e604c75a..15d6ff8aa8 100644 --- a/src/rm/RequestManagerPoolInfoFilter.cc +++ b/src/rm/RequestManagerPoolInfoFilter.cc @@ -108,8 +108,19 @@ void RequestManagerPoolInfoFilter::request_execute( { vector::iterator it; - uid_filter << "uid = " << att.uid << " OR " - << "gid = " << att.gid; + // Default rights: Users can see and use their resources, and + // the public ones in their group + uid_filter << "uid = " << att.uid << " OR "; + + // VMs don't have public column + if ( auth_object == AuthRequest::VM ) + { + uid_filter << "gid = " << att.gid; + } + else + { + uid_filter << "(gid = " << att.gid << " AND public = 1)"; + } for ( it=oids.begin(); it< oids.end(); it++ ) {