Page 1 of 1
Default document permissions
PostPosted:Mon Jan 20, 2014 7:57 am
by ivan.todorovic
Hi, I have one more question. After scanning or uploading in the certain folder document gets the same permissions that folder has. I am using workflow which automatically starts after upload or scan . In that workflow I am revoking permissions to every user except the user who did that upload. This might be a problem if user refreshes page after upload (when run_config starts), because workflow will not be executed and document will remain visible for other users. Is there a way to change this, so document can be seen only by the user who did the upload without running the workflow?
Re: Default document permissions
PostPosted:Thu Jan 23, 2014 10:24 am
by jllort
You should capture user from session and take it in consideration in your logic.
Code: Select allAuthentication auth = PrincipalUtils.getAuthentication();
auth.getName()
Re: Default document permissions
PostPosted:Fri Jan 24, 2014 9:12 am
by ivan.todorovic
Ok, but how can I get to that if user refreshes page after upload before workflow wizard starts (before user enters data on run_config and clicks accept)?
Re: Default document permissions
PostPosted:Sat Jan 25, 2014 11:49 am
by jllort
You should take control it, not in worflow, you should control if document creation -> at post ( after creation ) with scripting, have a look
http://wiki.openkm.com/index.php/Automation and
http://wiki.openkm.com/index.php/Scripting_-_OpenKM_6.2
The idea is take control of security during document creation ( post creation ) and not into workflow logic.
Re: Default document permissions
PostPosted:Mon Jan 27, 2014 12:54 pm
by ivan.todorovic
OK, but what if user needs to enter some paramethers which are important (and mandatory) for that document, right after upload?
For example document type or assigned user. I know that user can insert it after whole upload is done, by changing related metadata or permissions, but how to make sure he really does that?
As much as I remember workflow can not be run if there is even automation definition. Is there an easy way to change this?
Re: Default document permissions
PostPosted:Wed Jan 29, 2014 8:23 am
by ivan.todorovic
I have another idea. Can you tell me the class in the source code where permissions are granted after upload?
Re: Default document permissions
PostPosted:Sat Feb 01, 2014 4:21 pm
by jllort
Should take a look at DBDocumentModule.java but I think is not good idea change internal implementation. I continue thinking that Automation is right way to do it. And about automation and workflow, there's no limitation on start a workflow together.
Re: Default document permissions
PostPosted:Mon Feb 03, 2014 8:47 am
by ivan.todorovic
I found it here:
http://forum.openkm.com/viewtopic.php?f ... 3&start=15
Postby jllort » Sat Mar 16, 2013 8:58 am
"2- When you enable automation wizards are disabled. Actually from comunity version should be made some modification to set the wizards flags from automation."
Postby dip » Sun Mar 24, 2013 11:10 am
"And second, how can I disable automation to be able to test the wizard? At the moment the wizard does not show up since I previously enabled automation."
Postby jllort » Sun Mar 24, 2013 5:11 pm
"Is not possible to disable, you should delete all automation entries to disable. I think logic to switch profile wizard is based on looking for if it's present some automation definition, not any automation defitinion ( you can try disable all automation entries, but I'm not sure it going right )."
Are there any changes about this?
Re: Default document permissions
PostPosted:Mon Feb 03, 2014 1:03 pm
by ivan.todorovic
I solved it using DBDocumentModule (or to be more precise using BaseDocumentModule). It would be good if I could do it with automation, but anyway tnx a lot!
Re: Default document permissions
PostPosted:Tue Feb 04, 2014 6:49 pm
by jllort
Next release will come with extended extension support.