I have the following configuration (parts omitted for brevity)
All seems to be working well except file upload. If I change any permissions in the access control for the Administrator the permission change is reflected in CKFinder - stetting fileUpload to false will disable the upload button.
However, if fileUpload is set to true and I try to upload a file, I get the following error message
Changing the Role from <role>Administrator</role> to <role>*</role> allows me to upload files.
Any suggestions on what might be causing this issue?
<type name="Files"> <url>%BASE_URL%/</url> <directory>%BASE_DIR%</directory> <maxSize>15M</maxSize> <allowedExtensions>7z,aiff,asf,avi,bmp,csv,doc,docx,zip</allowedExtensions> <deniedExtensions></deniedExtensions> </type> no other types are listed ... <accessControl> <role>Administrator</role> <resourceType>*</resourceType> <folder>/</folder> <folderView>true</folderView> <folderCreate>true</folderCreate> <folderRename>true</folderRename> <folderDelete>true</folderDelete> <fileView>true</fileView> <fileUpload>true</fileUpload> <fileRename>true</fileRename> <fileDelete>true</fileDelete> </accessControl> No other access controls are listed
All seems to be working well except file upload. If I change any permissions in the access control for the Administrator the permission change is reflected in CKFinder - stetting fileUpload to false will disable the upload button.
However, if fileUpload is set to true and I try to upload a file, I get the following error message
It was not possible to complete the request due to authorization restrictions.
Changing the Role from <role>Administrator</role> to <role>*</role> allows me to upload files.
Any suggestions on what might be causing this issue?
Re: fileUpload permission issue
Does anyone from the company monitor this forum?
I have asked two questions on these forms (one more than a year ago), both of which went without response of any kind - what does one have to do to get some help around here?
Re: fileUpload permission issue
Is the Administrator role set in session scope?
Have you set value for userRoleSessionVar element?
Perhaps this link will be helpful.
http://docs.cksource.com/CKFinder_2.x/D ... ss_Control
Re: fileUpload permission issue
I don't know where I may have this mis-configured because it it otherwise working as expected:
1: if I log out, nothing is displayed.
2: if I change permission values in config.xml and log in as Administrator (or even while I am logged in) those permission changes are immediately reflected in the CKFinder UI - for example, setting fileupload to false disables the file upload button, setting fileRename to false disable file renaming, etc.
Everything is working as expected except file upload - if the fileUpload value is set to true, the button is enabled, but the flash upload reports "It was not possible to complete the request due to authorization restrictions".
Re: fileUpload permission issue
Through further investigation I have learned that there appears to be a new session being created during the upload - this new session is not logged in as anyone thus the userRole discovered by com.ckfinder.connector.handlers.command.Command.initParams does not have upload permissions.
I have not found the reason for the new session yet- still learning the ckFinder code base. In the end, it looks like the new session is the problem - if this were executing on the same session as the logged in user the upload would work properly. This also explains why changing the role to * works.
Wouldn't it be wonderful if the people that will eventually be paid for my use of this product would step up and actually help one of their potential customers? I wonder if that is just asking too much of ckSource?
Re: fileUpload permission issue
I think its likely that I have something wrong in my installation or configuration that is causing the original exception but poor quality of the debugging code is preventing me from finding the source of the problem.
The debug exception handling is so poorly written that it is causing a secondary exception. IllegalStateException:Committed
Really, production code with a call to printStackTrace? I am disappointed. The least you could do is use some sort of logging framework.
How about checking to see if the response is already committed?
How about not duplicating the debug logic everywhere?
How about logging the ConnectorException even if there is no inner exception?
How about doing the most important thing first in the debug block?
How about having your debug execution path be exactly the same as the non-debug execution path?
For example, move all of this logic into the handleError method that way you are not writing the code code over and over again - (maybe you just copy-paste?) Now the catch block looks like this....
That seems much more reasonable.
The code in handleError is also must more reasonable
I wonder how many lines of code these simple changes would remove?
Wow, this product is impressive - no support, no logging framework, exception handling that can cause exceptions, duplicate code all over the place, etc. Have you heard of code reviews? How about FindBugs, PMD, IntelliJ Idea, or any of the plethora of code analysis tools out there?
Again, thanks for all of your help and support!
Re: fileUpload permission issue
The exception is not the cause of the problem - the session i null immediately when the user selects the upload button, despite the fact that the must be logged in to get to the point where they can click the upload button.
Re: fileUpload permission issue
Have your read this topic in the docs?
http://docs.cksource.com/CKFinder_2.x/D ... ad_Problem
Re: fileUpload permission issue
Re: fileUpload permission issue
Yes, I had read that posting. I have not overridden checkAuthentication and the error message I get is not
The file browser is disabled for security reasons. Please contact your system administrator and check the CKFinder configuration file".
However, just to be safe, I did configure the FileUploadFilter - I will double check that I have it configured correctly and that it is being called.
Re: fileUpload permission issue