mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-25 11:39:12 +08:00
23 lines
299 B
Go
23 lines
299 B
Go
package filer
|
|
|
|
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
|
|
}
|