Forum Discussion

omair's avatar
omair
Contributor
8 years ago

Scripted assignment of permission

Hi,

Is it possible to script the assignment of SnapLogic permissions to a project space or a project through the REST API or a pipeline?

1 Reply

  • del's avatar
    del
    Contributor III

    @omair, You can use the SnapLogic Update snap (with “PROJECT” as the Asset Type parameter). I just tested something like this in UAT early this week. I was attempting to restrict permissions on the globally shared project (which I can’t do via UI). It was a test with unintended results, so don’t use the same code; but here’s some example code for the input.

    [
        {
            "asset_type": "Dir",
            "acl": [
                {
                    "perms": [
                        "R",
                        "X",
                        "W"
                    ],
                    "subject_type": "GROUP",
                    "inherit": true,
                    "subject": "admins"
                },
                {
                    "perms": [
                        "R"
                    ],
                    "subject_type": "GROUP",
                    "inherit": true,
                    "subject": "members"
                }
            ],
            "metadata": {}
        }
    ]
    

    You can use the SnapLogic Read snap to see what the initial configuration looks like.