From 3d45808a5822bb8d6bd66561010612457d5af03d Mon Sep 17 00:00:00 2001 From: Harendra Kumar Date: Wed, 19 Apr 2023 18:19:02 +0530 Subject: [PATCH] Add design notes --- src/Streamly/Coreutils/Chmod.hs | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/Streamly/Coreutils/Chmod.hs b/src/Streamly/Coreutils/Chmod.hs index 5dc2f1a6..409ceef6 100644 --- a/src/Streamly/Coreutils/Chmod.hs +++ b/src/Streamly/Coreutils/Chmod.hs @@ -9,6 +9,47 @@ -- -- change file mode bits. +-- TODO: change this module to Chmod.Posix and later create a portable module. +-- +-- Design notes: +-- +-- On Posix systems: +-- +-- Roles: User (Owner), group (only one), others +-- Permissions: rwxX(ugo), s(go), t(o) +-- +-- 1. write: create or delete a file in a directory. Modify contents of a file. +-- 2. write: modify metadata of a directory or file. +-- 3. execute: to list a directory's contents +-- +-- On Windows: +-- +-- Could not find any good docs by microsoft on a google search. +-- Managing permissions: https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc770962(v=ws.11) +-- https://learn.microsoft.com/en-us/windows/security/identity-protection/access-control/access-control +-- +-- Roles: User (Owner), group (many) +-- Permissions: read, read+execute, modify (metadata, create/delete files in +-- dirs), write (write to a file), list dir, full control +-- Inheritance: permissions can be inherited from parent directories +-- Advanced Permissions: ... +-- +-- 1. write: create or delete a file in a directory. Modify contents of a file. +-- 2. modify: modify metadata of a directory or file. +-- 3. list dir: to list a directory's contents +-- +-- Common abstraction for windows/posix: +-- +-- Roles: User/Owner +-- Permissions: +-- +-- 1. write on Posix: write+modify on windows +-- 2. execute on dir: "list dir" on windows +-- +-- Other's default permissions are controlled by umask on Posix. When setting +-- permissions we can ensure that other's permissions are less restrictive than +-- the owner? But we cannot do the same on windows. + module Streamly.Coreutils.Chmod ( chmod )