Skip to content

Commit 3d45808

Browse files
Add design notes
1 parent 4896d01 commit 3d45808

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

src/Streamly/Coreutils/Chmod.hs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,47 @@
99
--
1010
-- change file mode bits.
1111

12+
-- TODO: change this module to Chmod.Posix and later create a portable module.
13+
--
14+
-- Design notes:
15+
--
16+
-- On Posix systems:
17+
--
18+
-- Roles: User (Owner), group (only one), others
19+
-- Permissions: rwxX(ugo), s(go), t(o)
20+
--
21+
-- 1. write: create or delete a file in a directory. Modify contents of a file.
22+
-- 2. write: modify metadata of a directory or file.
23+
-- 3. execute: to list a directory's contents
24+
--
25+
-- On Windows:
26+
--
27+
-- Could not find any good docs by microsoft on a google search.
28+
-- Managing permissions: https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc770962(v=ws.11)
29+
-- https://learn.microsoft.com/en-us/windows/security/identity-protection/access-control/access-control
30+
--
31+
-- Roles: User (Owner), group (many)
32+
-- Permissions: read, read+execute, modify (metadata, create/delete files in
33+
-- dirs), write (write to a file), list dir, full control
34+
-- Inheritance: permissions can be inherited from parent directories
35+
-- Advanced Permissions: ...
36+
--
37+
-- 1. write: create or delete a file in a directory. Modify contents of a file.
38+
-- 2. modify: modify metadata of a directory or file.
39+
-- 3. list dir: to list a directory's contents
40+
--
41+
-- Common abstraction for windows/posix:
42+
--
43+
-- Roles: User/Owner
44+
-- Permissions:
45+
--
46+
-- 1. write on Posix: write+modify on windows
47+
-- 2. execute on dir: "list dir" on windows
48+
--
49+
-- Other's default permissions are controlled by umask on Posix. When setting
50+
-- permissions we can ensure that other's permissions are less restrictive than
51+
-- the owner? But we cannot do the same on windows.
52+
1253
module Streamly.Coreutils.Chmod
1354
( chmod
1455
)

0 commit comments

Comments
 (0)