core icon indicating copy to clipboard operation
core copied to clipboard

404 error after hit Resource Link of File Asset with Permissions

Open oarrietadotcms opened this issue 10 years ago • 3 comments

After giving permissions to a File Asset and try to hit the Resource Link, the user is redirected to the login page but the referrer is wrong and after successfully log in is redirected to a 404 page.

If the user tries to hit the Resource Link again (logged in), the File Asset is returned just fine.

Client Ticket: https://my.dotcms.com/tickets/detail.dot?id=afb33354-d68f-4a71-a4b1-797034757620

Expected Behavior

We need to set the referrer value properly and after log in, redirect the user to the File Asset asked originally.

Current Behavior

Referrer is set to "/dotasset/" without identifier or inode.

Possible Solution

Hotfix provided, linked below.

Known Workarounds

Use /dotAsset/[Identifier] instead Resource Link.

Steps to Reproduce (for bugs)

  1. Site Browser -> Create a test folder on root.
  2. Upload a File Asset into that folder.
  3. Remove CMS anon permission and add only Admin User View Permission.
  4. Go to front end and try to hit the Resource Link.
  5. Log in with Admin credentials.
  6. 404 error.

Your Environment

  • dotCMS version used: 3.3.2 and 3.6.0
  • Browser Name and version: Chrome - latest.
  • Operating System and version: Mac OS X
  • Application Server and version: Tomcat 8
  • Java Brand and version: Java 8
  • Database and version: H2 and Postgres

Important Notes

I will implement the hotfix for 3.3.2 but the fix for the current release needs to be aware of the language of the file also.

oarrietadotcms avatar Oct 20 '16 13:10 oarrietadotcms

Hotfix: https://github.com/dotCMS/support/tree/master/hotfixes/hotfix-GIT-9996_v3.3.2

oarrietadotcms avatar Oct 20 '16 13:10 oarrietadotcms

PR: https://github.com/dotCMS/core/pull/10517

Hey Guys, this Pull Request is intended to include changes previously done as part of hotfix into master-3-7 branch. Thanks!

agomez-dotcms avatar Jan 24 '17 17:01 agomez-dotcms

Passed QA. After logging in, the user is redirected to the File Asset asked originally. User is not being redirected to a 404 page as before. Tested with started data and cliente data. Database used: Postgres 9.3.5 / MySQL 5.6.23 Operating System: Ubuntu 14.04.1 / Mac OS 10.10.5

shaydotcms avatar Jan 26 '17 15:01 shaydotcms