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): ...@@ -408,12 +408,16 @@ class InstancePublisher(GenericPublisher):
portal_type="Person") portal_type="Person")
else: else:
raise NotImplementedError, "Can not get Person document" raise NotImplementedError, "Can not get Person document"
result = user.Person_findPartition( result = user.Person_restrictMethodAsShadowUser(
self.jbody['software_release'], shadow_document=user,
self.jbody['software_type'], callable_object=user.Person_findPartition,
('Software Instance', 'Slave Instance')[int(self.jbody['slave'])], argument_list=[
self.jbody['sla'], self.jbody['software_release'],
test_mode=True) self.jbody['software_type'],
('Software Instance', 'Slave Instance')[int(self.jbody['slave'])],
self.jbody['sla']],
argument_dict={
'test_mode': True})
except Exception: except Exception:
transaction.abort() transaction.abort()
LOG('SlapOSRestApiV1', ERROR, LOG('SlapOSRestApiV1', ERROR,
......
11 12
\ No newline at end of file \ 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