MatrixAI / js-encryptedfs

Encrypted Filesystem for TypeScript/JavaScript Applications
https://polykey.com
Apache License 2.0
10 stars 3 forks source link

Fix Permission Hierarchy - User, Group, Other permission checking #51

Open CMCDragonkai opened 2 years ago

CMCDragonkai commented 2 years ago

Specification

The current README.md states:

User, Group and Other permissions: In EFS User, Group and Other permissions are strictly confined to their permission class. For example, a User in EFS does not have the permissions that a Group or Other has while in Node FS a User also has permissions that Group and Other have.

Additional comments

@scottmmorris: when I was testing the permissions in efs, if a user didn't have write permissions a write wouldnt work in any case but I think for some of the pjdfs tests if this happened but the group or other had write permissions, even if the user didnt have the permissions it was supposed to work

The pjdfs tests are doing it correctly. Permissions are "hierarchical", meaning one should be checking user, group and other permissions.

Additional context

Tasks

  1. [ ] - Add back the permission tests from pjdfs
  2. [ ] - Update permission checking algorithm to properly match the expected behaviour