Inherited user permissions after importing from cli



  • In my deployed environment I have a folder structure like Parent1\Child1. I then have a user or a group (does not matter) that is assigned read permission to Parent1. When I save the permission it then propagates the read permission to child1 and also all the templates in child1. This all seems correct.

    On my local machine, which I do not have the same folder structure or users setup. I actually have my reports in a git repo. So I pull down the reports and make a change. I commit the changes to the repo, and that kicks of a build that exports the reports in the data folder to a ******.export file. Now there is a release pipeline job that calls the import api and imports (full) the the reports into folder child1. All of this process work fine.

    The issue is that user or group that has read permission to folder Parent1 no longer has access to the templates in Child1. When I look at the templates definitions the permissions arrays are empty. I believe this is because these permission are not setup on my local machine, nor will they ever be.

    Is there a API call that I can make after the import that will reapply permission to all of the templates in a folder?

    This is the reports json definition when the permission are applied.

    {
      "_id": "658ee96ded3f8e290fe16f35",
      "name": "XXXXXX_PDF",
      "engine": "handlebars",
      "recipe": "chrome-pdf",
      "data": {
        "shortid": "U8RewqKQC"
      },
      "shortid": "HXspsxMZzL",
      "chrome": {
        "printBackground": true,
        "marginTop": "0.5in",
        "marginBottom": "1in",
        "marginRight": "0.5in",
        "marginLeft": "0.5in",
        "landscape": true
      },
      "scripts": [
        {
          "shortid": "eVA2uyLwt"
        }
      ],
      "pdfOperations": [
        {
          "type": "merge",
          "templateShortid": "401aVyc",
          "mergeWholeDocument": true
        }
      ],
      "creationDate": "2024-03-08T21:11:00.330Z",
      "modificationDate": "2024-05-14T19:21:40.527Z",
      "readPermissions": [
        "655647240e547f0c8ce4ad55"
      ],
      "editPermissions": [
        "655647240e547f0c8ce4ad55"
      ],
      "inheritedReadPermissions": [
        "655647240e547f0c8ce4ad55",
        "djYU1HQqwKkVH0pt",
        "1hu3mVzzCOihZD5k",
        "Xug2ImE3flfCQORu",
        "jiYXyoH85oEE66oo",
        "0OPGx5fyhIAqbYjk"
      ],
      "inheritedEditPermissions": [
        "655647240e547f0c8ce4ad55",
        "1hu3mVzzCOihZD5k"
      ],
      "editPermissionsGroup": [
        "65969a2c1b470b8f062b6eaa"
      ],
      "folder": {
        "shortid": "IZvhxOL"
      }
    }
    

    This is the report definition after the import.

    {
      "_id": "658ee96ded3f8e290fe16f35",
      "name": "Critical_Date_PDF",
      "engine": "handlebars",
      "recipe": "chrome-pdf",
      "data": {
        "shortid": "U8RewqKQC"
      },
      "shortid": "HXspsxMZzL",
      "chrome": {
        "printBackground": true,
        "marginTop": "0.5in",
        "marginBottom": "1in",
        "marginRight": "0.5in",
        "marginLeft": "0.5in",
        "landscape": true
      },
      "scripts": [
        {
          "shortid": "eVA2uyLwt"
        }
      ],
      "pdfOperations": [
        {
          "type": "merge",
          "templateShortid": "401aVyc",
          "mergeWholeDocument": true
        }
      ],
      "creationDate": "2024-03-08T21:11:00.330Z",
      "modificationDate": "2024-05-15T11:53:28.885Z",
      "readPermissions": [
        "655647240e547f0c8ce4ad55"
      ],
      "editPermissions": [
        "655647240e547f0c8ce4ad55"
      ],
      "inheritedReadPermissions": [
        "655647240e547f0c8ce4ad55"
      ],
      "inheritedEditPermissions": [
        "655647240e547f0c8ce4ad55"
      ],
      "editPermissionsGroup": [
        "65969a2c1b470b8f062b6eaa"
      ],
      "folder": {
        "shortid": "IZvhxOL"
      }
    

    The Ids 655647240e547f0c8ce4ad55 and 65969a2c1b470b8f062b6eaa show up on my local machine. I am assuming those are the users my local dev environment is using and created when I added the report. As you can see the inheritedReadPermissions and inheritedEditPermissions are no longer present.

    Thanks



  • I cannot replicate this so far. Let's try together... I am on the jsreport 4.3.1.

    I start jsreport and create the following
    folderA -> templateA
    userA
    and add to folderA readPermissions for userA
    and export

    Then I start clean jsreport and create the following
    folderB -> templateB
    userB
    and add to folderB readPermissions for userB
    then I import the previous export to the folderB

    Now Iam checking the folderB -> folderA -> templateA and I see in the inheritedReadPermissions

     "inheritedReadPermissions": [
        "<userA>",
        "<userB>"
      ],
    

    Can you try the same using the studio? Does this work for you as well?



  • What you have does work. There is a difference between what you have and my scenario. I do not have a userA. Since this would be a development machine without user permissions turned on. The other part is when I do my import I do not have folderB->folderA->templateA. I would have folderB ->templateA.

    Dev machine:

    1. TemplateA

    Deployed Machine :

    1. ParentFolder ->FolderB
    2. User has permissions on FolderB.

    After Deploy:

    1. ParentFolder->FolderB -> TemplateA

    I have moved the permission up to ParentFolder and that seems to have kept them after deploy.



  • Hm... Still can't replicate it. The dev machine has disabled authentication as yours. I have there just template which I export.

    On the other machine, there is a folder and a user that has read permissions there.

    {
      "folder": null,
      "name": "folder",
      "creationDate": "2024-05-20T15:00:08.459Z",
      "modificationDate": "2024-05-20T15:00:26.719Z",
      "shortid": "U1so8YY",
      "inheritedReadPermissions": [],
      "inheritedEditPermissions": [],
      "_id": "H1nz2ZuHCnGbo8vF",
      "visibilityPermissions": [
        "Jn7avbeAW1Yi7d0i"
      ],
      "readPermissions": [
        "Jn7avbeAW1Yi7d0i"
      ]
    }
    

    I import it to this folder logged as administrator, and the template gets proper inherited permissions.

    {
      "name": "template",
      "engine": "handlebars",
      "recipe": "chrome-pdf",
      "shortid": "ioVgBh9qmh",
      "chrome": {
        "printBackground": true
      },
      "creationDate": "2024-05-20T15:00:26.711Z",
      "modificationDate": "2024-05-20T15:00:26.711Z",
      "_id": "TeNTFPCLekOAMOjI",
      "inheritedReadPermissions": [
        "Jn7avbeAW1Yi7d0i"
      ],
      "inheritedEditPermissions": [],
      "content": "aa",
      "folder": {
        "shortid": "U1so8YY"
      }
    }
    

    I've tried also with structure ParentFolder->Folder and import there. Still seems to work properly.



  • I upgraded to 4.3.1 today, I was not able to do it last week. It seems like it is working correctly now. Thank you for the work on trying to track this down. I will monitor it and reply back if there is any change.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.