rights = api.auth.determine_user_rights(caller_hrn, record)
# make sure caller has rights to this object
if rights.is_empty():
- raise PermissionError(caller_hrn + " has no rights to " + record['name'])
-
+ raise PermissionError("%s has no rights to %s (%s)" % \
+ (caller_hrn, object_hrn, xrn))
object_gid = GID(string=record['gid'])
new_cred = Credential(subject = object_gid.get_subject())
new_cred.set_gid_caller(caller_gid)
def Resolve(self, api, xrns, type=None, full=True):
if not isinstance(xrns, types.ListType):
- xrns = [xrns]
# try to infer type if not set and we get a single input
if not type:
type = Xrn(xrns).get_type()
+ xrns = [xrns]
hrns = [urn_to_hrn(xrn)[0] for xrn in xrns]
# load all known registry names into a prefix tree and attempt to find
# the longest matching prefix