permission.go 299 B

12345678910111213141516171819202122
  1. package filer
  2. func hasWritePermission(dir *Entry, entry *Entry) bool {
  3. if dir == nil {
  4. return false
  5. }
  6. if dir.Uid == entry.Uid && dir.Mode&0200 > 0 {
  7. return true
  8. }
  9. if dir.Gid == entry.Gid && dir.Mode&0020 > 0 {
  10. return true
  11. }
  12. if dir.Mode&0002 > 0 {
  13. return true
  14. }
  15. return false
  16. }