+### $Id$
+### $URL$
+
+from geni.trust.credential import *
+from geni.trust.rights import *
from geni.util.faults import *
-from geni.util.excep import *
from geni.util.method import Method
from geni.util.parameter import Parameter, Mixed
from geni.util.auth import Auth
from geni.util.record import GeniRecord
-from geni.util.credential import *
-from geni.util.rights import *
from geni.util.debug import log
class get_credential(Method):
for rec in records:
if type in ['*'] or rec.get_type() in [type]:
record = rec
+ if not record:
+ raise RecordNotFound(hrn)
gid = record.get_gid_object()
peer_cert = self.api.auth.peer_cert
if not peer_cert.is_pubkey(gid.get_pubkey()):
rights = self.api.auth.determine_user_rights(None, record)
if rights.is_empty():
- raise PermissionError(self.api.auth.client_cred.get_gid_object().get_hrn() + " has no rights to " + record.get_name())
+ raise PermissionError(gid.get_hrn() + " has no rights to " + record.get_name())
# create the credential
gid = record.get_gid_object()