[MGNLREST-176] Delivery endpoint returns all node-types when only mgnl:folder is configured Created: 09/Mar/18  Updated: 02/May/18  Resolved: 23/Mar/18

Status: Closed
Project: Magnolia REST Framework
Component/s: None
Affects Version/s: 2.0.2
Fix Version/s: 2.1.1

Type: Bug Priority: Major
Reporter: Christopher Zimmermann Assignee: Sang Ngo Huu
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 5h
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Sprint: Saigon 139
Story Points: 3

 Description   

With this v1 configuration, the endpoint response includes additional unwanted results when using the 2.1-SNAPSHOT of the content delivery module.

Params:

  ideas:
    workspace: ideas
    depth: 0
    nodeTypes:
      - mgnl:folder
    childNodeTypes:
      - mgnl:composition
    includeSystemProperties: true
    bypassWorkspaceAcls: true
    limit: 100 

(Above example is a content-editor based app, like the stories app.)

With this query:

http://localhost:8080/magnoliaAuthor/.rest/delivery/ideas/v1?orderBy=jcr:created%20asc 

Gives these unwanted additional results:

{
  "results": [
    {
      "@name": "",
      "@path": "/",
      "@id": "cafebabe-cafe-babe-cafe-babecafebabe",
      "@nodeType": "rep:root",
      "@nodes": []
    },
    {
      "@name": "entry",
      "@path": "/rep:accesscontrol/everyone/rep:policy/entry",
      "@id": "3e092b18-2bbb-4146-ae5b-546bd5cab397",
      "@nodeType": "rep:GrantACE",
      "rep:privileges": [
        "jcr:read"
      ],
      "rep:nodePath": "",
      "rep:principalName": "everyone",
      "@nodes": []
    },
    {
      "@name": "everyone",
      "@path": "/rep:accesscontrol/everyone",
      "@id": "b43e10d7-cfb3-437c-a28d-0930dcd38ac9",
      "@nodeType": "rep:PrincipalAccessControl",
      "@nodes": []
    },
    {
      "@name": "rep:accesscontrol",
      "@path": "/rep:accesscontrol",
      "@id": "1ccce36d-7a63-4212-b673-caf6892fa8cd",
      "@nodeType": "rep:AccessControl",
      "@nodes": []
    },
    {
      "@name": "rep:policy",
      "@path": "/rep:accesscontrol/everyone/rep:policy",
      "@id": "60ef74ab-7fd2-4ebc-981a-87b30ef9c000",
      "@nodeType": "rep:ACL",
      "@nodes": []
    },
    { 

Followed by the expected results.

 

I also have the problem that I expect just the "mgnl:composition" nodes, but I ALSO get the "mgnl:block" nodes under them which I do not want.

 

 



 Comments   
Comment by Christopher Zimmermann [ 09/Mar/18 ]

I just checked, version 2.0 of REST did not have this bug. IE did not include those 5 unwanted elements listed above on "mgnl:folder". 

That was due to a different config on the instance running 2.0

Comment by Hieu Nguyen Duc [ 12/Mar/18 ]

Just tested. It seems to occurs in 2.0 as well.

{
    "results": [
        {
            "@name": "",
            "@path": "/",
            "@id": "cafebabe-cafe-babe-cafe-babecafebabe",
            "@nodeType": "rep:root",
            "@nodes": []
        },
        ...
        {
            "@name": "rep:policy",
            "@path": "/rep:accesscontrol/everyone/rep:policy",
            "@id": "9fe0c23d-7c2a-44f7-9874-90c9f5d4df59",
            "@nodeType": "rep:ACL",
            "@nodes": []
        },
        {
            "@name": "rep:accesscontrol",
            "@path": "/rep:accesscontrol",
            "@id": "0d3526b7-d299-4821-aecd-ad419218aabe",
            "@nodeType": "rep:AccessControl",
            "@nodes": []
        },
        {
            "@name": "everyone",
            "@path": "/rep:accesscontrol/everyone",
            "@id": "b06229b6-5f00-4577-b1ba-1a61b175bd08",
            "@nodeType": "rep:PrincipalAccessControl",
            "@nodes": []
        },
        {
            "@name": "entry",
            "@path": "/rep:accesscontrol/everyone/rep:policy/entry",
            "@id": "d2205db6-2760-43ac-88b9-426f5663c2d9",
            "@nodeType": "rep:GrantACE",
            "rep:principalName": "everyone",
            "rep:privileges": [
                "jcr:read"
            ],
            "rep:nodePath": "",
            "@nodes": []
        },

Query

SELECT t.* FROM [nt:base] AS t ORDER BY LOWER(NAME(t))
Comment by Christopher Zimmermann [ 12/Mar/18 ]

OK. Thanks for check it out Hieu. There must be some other factor that is causing those nodes not to be displayed in my project - maybe its related to permissions.

Generated at Mon Feb 12 06:57:22 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.