Document Creation Failes With Entity Ref Error If Project Is Inaccessible
Status: Beta
Brought to you by:
whitemice
Creating a document in a folder fails with a queer message if the context does not have access to the project - even if the context explicitly has access to the folder. This should either fail with a nice AccessDenied or it should be permitted (the project marshaled without access limitations). The project is accessed in order to see if inherited ACLs are enabled.
2014-07-15 17:12:21,934 10937 context duration of project::get was 0.033
2014-07-15 17:12:21,941 10937 document::new Unable to marshall projectId#19680 related to specified folderId#168065529
2014-07-15 17:12:21,941 10937 http Unable to understand None as an entity reference (objectId)
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc87-py2.6.egg/coils/net/http_handler.py", line 209, in process_request
)(self.request_name, )
File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc87-py2.6.egg/coils/protocol/attachfs/entityobject.py", line 413, in do_PUT
self._put_file_mode(name, scratch_file, mimetype)
File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc87-py2.6.egg/coils/protocol/attachfs/entityobject.py", line 288, in _put_file_mode
handle=scratch_file,
File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc87-py2.6.egg/coils/core/context.py", line 566, in run_command
command.run()
File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc87-py2.6.egg/coils/logic/blob/create_document.py", line 112, in run
self.inherit_acls()
File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc87-py2.6.egg/coils/logic/blob/command.py", line 198, in inherit_acls
'inheritACLs', )
File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc87-py2.6.egg/coils/core/propertymanager.py", line 137, in get_property
object_id = PropertyManager.Get_Object_Id(entity)
File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc87-py2.6.egg/coils/core/propertymanager.py", line 75, in Get_Object_Id
format(value, )
CoilsException: Unable to understand None as an entity reference (objectId)
2014-07-15 17:12:21,984 10937 context Closing context ff6de42a865b454e9bbe1dbb2767caaf
Diff:
This code in run() of CreateDocument produces the cannot-marshal-project method, but later on the inherit_acls call does not check if the project id has been initialized - and it should always be set irregardless, assuming the user was able to create the document which is the duty of check_permissions
run
inherit_acls