{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/37813","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/37813/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/37813/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/37813/events","html_url":"https://github.com/saltstack/salt/pull/37813","id":190788927,"number":37813,"title":"Windows Perms for file.directory and file.managed","user":{"login":"twangboy","id":9383935,"avatar_url":"https://avatars.githubusercontent.com/u/9383935?v=3","gravatar_id":"","url":"https://api.github.com/users/twangboy","html_url":"https://github.com/twangboy","followers_url":"https://api.github.com/users/twangboy/followers","following_url":"https://api.github.com/users/twangboy/following{/other_user}","gists_url":"https://api.github.com/users/twangboy/gists{/gist_id}","starred_url":"https://api.github.com/users/twangboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twangboy/subscriptions","organizations_url":"https://api.github.com/users/twangboy/orgs","repos_url":"https://api.github.com/users/twangboy/repos","events_url":"https://api.github.com/users/twangboy/events{/privacy}","received_events_url":"https://api.github.com/users/twangboy/received_events","type":"User","site_admin":false},"labels":[{"id":77737132,"url":"https://api.github.com/repos/saltstack/salt/labels/Pending%20Discussion","name":"Pending Discussion","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-11-21T17:46:26Z","updated_at":"2016-11-29T21:22:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/saltstack/salt/pulls/37813","html_url":"https://github.com/saltstack/salt/pull/37813","diff_url":"https://github.com/saltstack/salt/pull/37813.diff","patch_url":"https://github.com/saltstack/salt/pull/37813.patch"},"body":"### What does this PR do?\r\nAdds ability to set owner and user/group permissions for ``file.directory`` and ``file.managed``. Also fixes an issue with ``salt.utils.win_dacl.set_owner`` where you couldn't set ownership to a group you weren't a member of or another group. Tried to make minimal changes to the ``file.py`` state module and make changes in ``win_file.py`` execution module where possible.\r\n\r\nAdds 4 new parameters to ``file.directory`` and ``file.managed``.\r\n\r\nwin_owner (str)\r\nwin_perms (dict)\r\nwin_deny_perms (dict)\r\nwin_inheritance (bool)\r\n\r\nUltimately the goal is to implement this into the rest of the state functions in the ``file.py`` state module.\r\n\r\n### What issues does this PR fix or reference?\r\nhttps://github.com/saltstack/salt/issues/28920\r\n\r\n### Previous Behavior\r\nPermissions settings weren't being set on ``file.directory`` and ``file.managed``\r\n\r\n### New Behavior\r\nYou can now set permissions for ``file.directory`` and ``file.managed``\r\n\r\n### Tests written?\r\nNo"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/263703046","html_url":"https://github.com/saltstack/salt/pull/37813#issuecomment-263703046","issue_url":"https://api.github.com/repos/saltstack/salt/issues/37813","id":263703046,"user":{"login":"twangboy","id":9383935,"avatar_url":"https://avatars.githubusercontent.com/u/9383935?v=3","gravatar_id":"","url":"https://api.github.com/users/twangboy","html_url":"https://github.com/twangboy","followers_url":"https://api.github.com/users/twangboy/followers","following_url":"https://api.github.com/users/twangboy/following{/other_user}","gists_url":"https://api.github.com/users/twangboy/gists{/gist_id}","starred_url":"https://api.github.com/users/twangboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twangboy/subscriptions","organizations_url":"https://api.github.com/users/twangboy/orgs","repos_url":"https://api.github.com/users/twangboy/repos","events_url":"https://api.github.com/users/twangboy/events{/privacy}","received_events_url":"https://api.github.com/users/twangboy/received_events","type":"User","site_admin":false},"created_at":"2016-11-29T21:22:50Z","updated_at":"2016-11-29T21:22:50Z","body":"@damon-atkins The problem is that user, group, and mode don't translate to the Windows ACL. New parameters were added to handle ownership and permissions in Windows. All permissions are set using the `win_dacl` utility to avoid shelling out in Windows (unicode translation problems).\r\n\r\n@cachedout I assume you're talking about the mkdir, makedirs, and makedirs_perms functions. I did change these in `win_file.py` so that all directory creation is handled by the `mkdir` function. Some of the logic is similar but differs greatly when it goes to set permissions and ownership. I wouldn't think you'd want a bunch of gated Windows calls in `file.py` when we already have a `win_file.py`. \r\nAdditionally, I kept the function names the same so I wouldn't have to edit the state module too much."}}
{"actor":{"display_login":"twangboy"}}