Commit ba05d728 authored by Romain Courteaud's avatar Romain Courteaud

Fixup 83e731d9.

Only shadow user is allowed to access public machine.
parent 9bb5accb
......@@ -408,12 +408,16 @@ class InstancePublisher(GenericPublisher):
portal_type="Person")
else:
raise NotImplementedError, "Can not get Person document"
result = user.Person_findPartition(
self.jbody['software_release'],
self.jbody['software_type'],
('Software Instance', 'Slave Instance')[int(self.jbody['slave'])],
self.jbody['sla'],
test_mode=True)
result = user.Person_restrictMethodAsShadowUser(
shadow_document=user,
callable_object=user.Person_findPartition,
argument_list=[
self.jbody['software_release'],
self.jbody['software_type'],
('Software Instance', 'Slave Instance')[int(self.jbody['slave'])],
self.jbody['sla']],
argument_dict={
'test_mode': True})
except Exception:
transaction.abort()
LOG('SlapOSRestApiV1', ERROR,
......
11
\ No newline at end of file
12
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment