You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
299 B

  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. }