core icon indicating copy to clipboard operation
core copied to clipboard

[Permissions] Content Types do not show Permissions if Site/Folder value is a Folder

Open joseorsini opened this issue 8 years ago • 4 comments

If we create/update a content type and set its Site/Folder value to a Folder, the system doesn't show the permissions this content type is inheriting. It should show it's inheriting from its parent folder.

Now, if we create assets under this Folder, we can see that new files are inheriting permissions from it.

Expected Behavior

If a folder is set on Site/Folder attribute of a Content Type, then permissions should reflect it's inheriting permissions from this parent object, in the same way it does if a Site was selected.

Current Behavior

An empty permissions list is displayed.

Possible Solution

Check permissions inheritance for content type if a Site or Folder is selected. By switching values here, we should:

  • Show consistently where it's inheriting permissions from.
  • Update permissions once the value is updated.
  • Question: If a content type has individual permissions and this Site/Folder attribute is changed, should we reset permissions here?

Known Workarounds

Steps to Reproduce (for bugs)

  1. Create a folder called /uploads on demo.dotcms.com site.
  2. Create a File-type Content Type called "User Upload". Select "demo.dotcms.com/uploads" folder as its Site/Folder value:
screen shot 2017-12-06 at 1 47 26 pm
  1. Check its permissions tab. Shows empty, and should show permissions are inherited from this folder.
screen shot 2017-12-06 at 1 47 37 pm
  1. Go to Site Browser and upload a User Upload file to it.
  2. Once it's uploaded, check its permissions. It's inheriting permissions from demo.dotcms.com site
screen shot 2017-12-06 at 2 03 20 pm

Context

Reported by customer: https://dotcms.zendesk.com/agent/tickets/94881

Your Environment

  • dotCMS version used: 4.2.x.
  • Browser Name and version: Any Browser.
  • Operating System and version: Any OS.
  • Application Server and version: Any Application Server.
  • Java Brand and version: Any Supported Java 8 Server.
  • Database and version: Any DB.
  • Application module (if apply): N/A.

joseorsini avatar Dec 06 '17 20:12 joseorsini

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

erickgonzalez avatar Jan 30 '18 20:01 erickgonzalez

Passed QA After creating a File type Content Type called "User Upload" and selecting "demo.dotcms.com/uploads" folder as its Site/Folder value, permissions tab is actually showing. image

Then I uploaded file to "User Upload" and checked its permissions. It's inheriting permissions from demo.dotcms.com site image

Mac OS 10.10 / Postgres 9.6 / Chrome v54.0.2840.98 / Tomcat 8 / Java 8

shaydotcms avatar Jan 31 '18 20:01 shaydotcms

Note to QA: please test the following scenarios:

  • Create content type that lives under demo.dotcms.com. Make sure content type's permissions are inherited from demo.
  • Create content type that lives under folder, which inherits permissions from demo.dotcms.com. Make sure content type's permissions are inherited from demo.
  • Create content type that lives under folder, which has individual permissions (you need to check everything under 'Contributor' Role). Make sure content type's permissions are inherited from folder with individual perms.

dsilvam avatar Feb 02 '18 23:02 dsilvam

Passed QA. Tested scenarios mentions on "Note to QA"

  • Created a content type that lives under demo.dotcms.com and verified that content type's permissions are inherited from demo. image
  • Created a content type that lives under folder, which inherits permissions from demo.dotcms.com and verified that content type's permissions are inherited from demo. image
  • Created content type that lives under folder, which has individual permissions and verified that content type's permissions are inherited from folder with individual perms. image

Mac OS 10.10 / Postgres 9.6 / Chrome v54.0.2840.98 / Tomcat 8 / Java 8

shaydotcms avatar Feb 05 '18 21:02 shaydotcms