seaweedfs/weed/filer/permission.go

23 lines
299 B
Go
Raw Permalink Normal View History

2020-09-01 07:21:19 +00:00
package filer
2018-05-12 20:45:29 +00:00
func hasWritePermission(dir *Entry, entry *Entry) bool {
if dir == nil {
return false
}
if dir.Uid == entry.Uid && dir.Mode&0200 > 0 {
return true
}
if dir.Gid == entry.Gid && dir.Mode&0020 > 0 {
return true
}
if dir.Mode&0002 > 0 {
return true
}
return false
}