View/Edit #1:fileaccess file_access

Switch to edit mode.

Name(s): fileaccess file_access
1:  "There are two levels of security implemented in the file system."
2:  "'r': Any MOO programmer can access it via <object>:fileread(<name>), and web users can access it directly."
3:  "'': Only the owner of the object or a wizard has permission to read it, no direct web access."
4:  fs = $file_utils:filespec(this, args[1])
5:  raw_access = file_mode(fs)
6:  if (toint(raw_access[3]) >= 4)
7:    "world readable, assume it's meant to be public (afterall, it already is..)"
8:    if (raw_access != "664")
9:      `call_function("filechmod", fs, "664") ! ANY'
10:   endif
11:   return "r"
12: else
13:   if (raw_access != "660")
14:     `call_function("filechmod", fs, "660") ! ANY'
15:   endif
16:   return ""
17: endif
18: "Last modified by Lao-Tzu (#8084) on Tue Aug 24 20:50:54 1999 MDT."
19: "This verb previously owned by manta (#7165), and chowned to $slacker upon dewizarding (Sat Aug 17 14:50:04 2002 MDT)."
20: "Last modified by Dax (#789) on Tue May  3 14:11:53 2005 MDT."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Slacker (#55)

You are not logged in.

[home | help | who | search | setup | code]