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
22 lines
299 B
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
|
|
}
|