go-storage icon indicating copy to clipboard operation
go-storage copied to clipboard

services/fs: Proposal: Support file permission and owner

Open Xuanwo opened this issue 3 years ago • 0 comments

We could introduce file permission and owner support via add new service pair and metadata.

Proposal

Pair

permission could be set in open, but uid/gid may need a call to Chown.

  • permission: uint32, The permission of this object (for Write related operation)
  • uid: uint32, The uid of this object
  • gid: uint32, The gid of this object

Metadata

We could extract following metadata from f.Sys().(*syscall.Stat_t) (unix only)

  • permission: uint32, The permission of this object
  • uid: uint32, The uid of this object
  • gid: uint32, The gid of this object

Retional

  • How to support permission control on windows? As windows have different concepts compared to Unix alike system.
    • we could just ignore the support for windows for now.

Xuanwo avatar Apr 25 '21 06:04 Xuanwo