blob: 31fe43b3c3b8bd4c664e3442891ecd7a20f4ee29 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
2 string valid_write(string path, string uid, string func, object ob)
3
4DESCRIPTION
5 This function is called to check if the object ob with the
6 user-id uid has write permissions to the file given by path
7 for the operation named by func. It should return 0 if
8 permission is denied, or the normalized path if permission is
9 granted. You can also return 1 to indicate that the path can
10 be used unchanged.
11
12 The returned pathname must not contain ``..'', a leading /
13 will be stripped by the interpreter.
14
15 Func denotes the efun call or other operation that caused
16 valid_write() to be called:
17 cindent,
18 do_rename (efun rename(), for the old and then for the new name),
19 ed_start (whenever the builtin ed tries to write to a file),
20 mkdir,
21 remove_file (efun rm()),
22 rmdir,
23 save_object,
24 write_bytes,
25 write_file.
26
27 Note that this function is called in compat mode as well. If
28 you need to be compatible with the old 2.4.5-mudlib, redirect
29 these calls to the valid_read/valid_write in the user
30 object.
31
32SEE ALSO
33 valid_read(M), make_path_absolute(M)