Content Admins cannot upload files

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
11/16/2014 12:50:53 PM
Gravatar
Total Posts 537
feet planted firmly on the ground

Content Admins cannot upload files

Users in the Content Administrators role are unable to upload any files through the CKEditor. In the "Upload a file" area they see the progress bar go up, then "Oops something went wrong uploading, you may want to contact the site administrator an error was probably logged."

In the system log we have:

2014-11-16 18:34:26,909 INFO 31.185.225.7 - en-GB - /Dialog/FileDialog.aspx?ed=&type=image&dir=&tbi= - mojoPortal.Web.Services.FileService - user not in allowed upload roles so returning 404

The user is able to upload the same file using the File Manager.

As I understand it Content Administrators is one of the special roles that always by definition has permission to browse and upload files (so it doesn't appear as one of the roles to which this permission can be granted or removed).  We have aliased this role, which I thought might have caused the problem, but we removed the alias in the database and the problem persisted.

If we make the same user an Administrator, or if we add them to another custom role to which we have granted permissions to "browse and upload files", they can do so without problems.

It smells like a bug, but we could have got something wrong in the config!

mojoPortal Version 2.4.0.3 MSSQL
Operating System Microsoft Windows NT 6.0.6002 Service Pack 2
ASP.NET Info v4.0.30319 Running in Full Trust
 

11/18/2014 12:47:53 PM
Gravatar
Total Posts 18439

Re: Content Admins cannot upload files

Yes, Content Administrators role should be able to upload.

I'm not able to produce the problem on our demo site. I created a new user, added the user to Content Admins role then logged in as that user and was able to upload an image through the editor dialog

Is the problem limited to a specific content instance or the same happens in any instance of html content?

11/18/2014 7:05:21 PM
Gravatar
Total Posts 128

Re: Content Admins cannot upload files

I have investigated some more, and also upgraded this site to 2.4.0.4.

The issue persists. We temporarily had some bad folder permissions, possibly due to having to copy the whole site folders around a couple of times during failed upgrades. So initially my test account in the "Content Administrators"  role could not create a folder under media... now it can create a sub-folder through the "browse server" dialogue. However it still cannot upload even a small image file. This applies to any HTML Content instance. Again I get this in the system log:

2014-11-19 00:51:02,647 INFO (null) - (null) - (null) - mojoPortal.Web.Services.FileService - user not in allowed upload roles so returning 404

Yet a user in the "Admins" can upload just fine. 

I'm wondering how the code detects these special roles...? Is it on role name? GUID? Could we have changed something inadvertently?

Here is our mp_Roles, with the affected row in bold, and showing that this role is aliased:

1 1 Admins ESDM Staff Site Administrators a4f6cdfe-ac46-42d8-9aa0-677e9b610580 c9a593f6-a346-4bb1-956a-8d121c5f77fe
2 1 Role Admins Role Administrators a4f6cdfe-ac46-42d8-9aa0-677e9b610580 b0bc5fa5-33d7-4852-94f2-2cb11d0747f5
3 1 Content Administrators ESDM Staff Content Admin a4f6cdfe-ac46-42d8-9aa0-677e9b610580 49b5fb3e-5102-41c4-b38e-3ebe691a1b6f
4 1 Authenticated Users All Authenticated Users a4f6cdfe-ac46-42d8-9aa0-677e9b610580 5b735417-2203-4030-a4dc-88edccc0b3bc
7 1 Newsletter Administrators ESDM Newsletter Admins a4f6cdfe-ac46-42d8-9aa0-677e9b610580 2fcc561f-81d1-40ba-805e-18ca1a4bb391
8 1 ESDM Client ESDM Client a4f6cdfe-ac46-42d8-9aa0-677e9b610580 f775e4e4-ef65-4e72-a6f8-f33236f8c5ec
10 1 ESDM Potential Client ESDM Potential Client a4f6cdfe-ac46-42d8-9aa0-677e9b610580 7fa9649c-c7c3-440e-a15e-1410c303ea96
13 1 CMSi Consortium CMSi Consortium a4f6cdfe-ac46-42d8-9aa0-677e9b610580 0a0b1081-4ae6-426e-9782-40d143aeb1dc
14 1 CMSi Developers CMSi Developers a4f6cdfe-ac46-42d8-9aa0-677e9b610580 d81f4106-31b8-4f97-ae1d-61a73b3edcda
15 1 ESDM Staff Read Only ESDM Staff Read Only a4f6cdfe-ac46-42d8-9aa0-677e9b610580 993c0ef0-0728-430a-b148-adb9fd60d07a
16 1 Marine Recorder Development Marine Recorder Development a4f6cdfe-ac46-42d8-9aa0-677e9b610580 38389383-eb24-47a0-9fbf-a410f43db30e
17 1 PACS Client PACS Client a4f6cdfe-ac46-42d8-9aa0-677e9b610580 0d64e11f-bb76-48d5-b0f6-f3c4dd82bec8
18 1 temp role ESDM File upload role a4f6cdfe-ac46-42d8-9aa0-677e9b610580 b864c95b-21c4-43f6-a9e7-a1137d704af9

 

11/19/2014 11:21:25 AM
Gravatar
Total Posts 18439

Re: Content Admins cannot upload files

It does appear to be a bug based on code review, I can fix this for the next release. As a workaround until then I suggest create custom role that is allowed to upload and then add Content Admins to that role.

user roles are stored in an encrypted cookie by rolename (not displayname and not guid). It is best in general not to add users to more roles than needed, ie Admins don't need other roles. If a user has too many roles it can be a problem because there are limits to the cookie size and it would truncate if there were too many to fit. 

Thanks,

Joe

11/19/2014 11:27:00 AM
Gravatar
Total Posts 128

Re: Content Admins cannot upload files

Ah thanks for confirming that Joe, and yes that's actually what we've done as an interim measure.  Looking forward to the upgrade.

 

Incidentally, I had a headache with the upgrade to 2.4.0.4 because of one particular web.config mod we had.  This setting appears to be incompatible with .Net 4.5.1:

<clientCache httpExpires...

when I tracked it down and commented it out, all was well. I've not looked into it further as it was 2am by the time I fixed it!

You must sign in to post in the forums. This thread is closed to new posts.