Esri / arcgis-cookbook

Chef cookbooks for ArcGIS
Apache License 2.0
290 stars 115 forks source link

BUG: arcgis-enterprise::datasources does not set permission for shared folder #301

Closed jesa-esrich closed 2 years ago

jesa-esrich commented 2 years ago

In ArcGIS Chef Cookbooks 10.8.1 and 10.9.1 the permission for the shared folders are not set properly.

Steps to reproduce:

Expected Behavior:

cameronkroeker commented 2 years ago

Hi @jesa-esrich,

I am unable to reproduce this issue. Here is a snippet of my json file, and snippet of debug logs:


{
    "arcgis": {
        "version": "10.9.1",
        "run_as_user": "arcgis",
        "run_as_password": "Pa$$w0rdPa$$w0rd", 
        "server": {

        },
    "datasources": {
            "server_config_url": "https://MachineHostName.myDomain.com:6443/arcgis",
            "block_data_copy": true,
            "folders": [
            {
                            "server_path": "C:\\Mapfiles",
                            "create_folder": true,
                            "security_permissions": {
                                   "authorize_arcgis_service_account": true,
                                   "full_control_members": ["myDomain\\user1","myDomain\\agstest"]
                },
                "share_folder": true,
                "share_name": "Mapfiles",
                "sharing_permissions": {
                   "full_control_members": ["myDomain\\user1","myDomain\\agstest"]
                },
                "publish_folder": {
                   "identifier": "Mapfiles",
                   "publish_with_hostname": true
                }
            }
           ]
        },
    "misc": {
        "scripts_dir": "C:\\cinc\\misc_scripts"
    }
    },
    "run_list": [
        "recipe[arcgis-enterprise::datasources]"
    ]
}

Cinc Run Debug Logs:

[2022-02-03T13:58:17-08:00] INFO: Processing directory[C:\Mapfiles] action create (C:/Users/user1/.cinc/local-mode-cache/cache/cookbooks/arcgis-enterprise/providers/datasources.rb line 39)
[2022-02-03T13:58:17-08:00] INFO: directory[C:\Mapfiles] created directory C:\Mapfiles
[2022-02-03T13:58:17-08:00] INFO: directory[C:\Mapfiles] permissions changed to [myDomain\user1/flags:3/mask:10000000]
[2022-02-03T13:58:17-08:00] INFO: Processing directory[C:\Mapfiles] action create (C:/Users/user1/.cinc/local-mode-cache/cache/cookbooks/arcgis-enterprise/providers/datasources.rb line 39)
[2022-02-03T13:58:17-08:00] INFO: directory[C:\Mapfiles] permissions changed to [myDomain\agstest/flags:3/mask:10000000]
[2022-02-03T13:58:17-08:00] INFO: Processing directory[C:\Mapfiles] action create (C:/Users/user1/.cinc/local-mode-cache/cache/cookbooks/arcgis-enterprise/providers/datasources.rb line 47)
[2022-02-03T13:58:17-08:00] INFO: directory[C:\Mapfiles] permissions changed to [MachineHostName\arcgis/flags:3/mask:10000000]
[2022-02-03T13:58:17-08:00] INFO: Processing arcgis_enterprise_datasources[Share folder C:\Mapfiles] action share_folder (arcgis-enterprise::datasources line 85)
[2022-02-03T13:58:17-08:00] INFO: Processing powershell_script[Share directory Mapfiles] action run (C:/Users/user1/.cinc/local-mode-cache/cache/cookbooks/arcgis-enterprise/providers/datasources.rb line 65)
[2022-02-03T13:58:24-08:00] INFO: powershell_script[Share directory Mapfiles] ran successfully

In you chef run log do you see similar messages such as INFO: directory[C:\Mapfiles] permissions changed to [myDomain\agstest/flags:3/mask:10000000] ?

Thanks, Cameron K.

jesa-esrich commented 2 years ago

Hi @cameronkroeker I checked the whole thing on my side again. I get the same messages as you: INFO: directory[C:\Mapfiles] permissions changed to [myDomain\agstest/flags:3/mask:10000000]

In my understanding the user should normally show up when checking the permission to the directory. Which means if I check the folder with right click Properties > Security or Sharing > Share.. the User should be listed. However this is not the case which confused the customer and me.

On second check the user has access to the directory, as expected. But this is not visible by checking the permissions on the folder. To have a real view of all the effective accesses the advanced settings have to be checked, as explained here: https://www.lepide.com/how-to/track-permissions-applied-on-files-and-folders-in-windows-file-server.html#:~:text=Step%202%20%E2%80%93%20Right%2Dclick%20the,a%20particular%20file%20or%20folder.

Hence, this was a misinterpretation on my side and the customer. I will therefore close the issue. Sorry for the inconvenience.