Make sure to actually check code returned from user_can_... before moving on!

This commit is contained in:
Sam Greytalon 2024-01-15 16:15:16 -08:00
parent b8b7fc68bd
commit 3867f4543a
1 changed files with 9 additions and 4 deletions

View File

@ -343,6 +343,7 @@ sub make_size_human_readable ($size) {
sub user_save_file_to_path ($user, $file, $path) {
my ( $code, $message ) = check_user_can_create_file($user, $path);
return $code, $message if $code != 200;
( $code, $message ) = check_dexter_can_create_file($path);
return $code, $message if $code != 200;
@ -355,6 +356,7 @@ sub user_save_file_to_path ($user, $file, $path) {
sub user_mkdir_at_path ($user, $path) {
my ( $code, $message ) = check_user_can_create_file($user, $path);
return $code, $message if $code != 200;
( $code, $message ) = check_dexter_can_create_file($path);
return $code, $message if $code != 200;
@ -367,6 +369,7 @@ sub user_mkdir_at_path ($user, $path) {
sub user_delete_path ($user, $path) {
my ( $code, $message ) = check_user_can_delete_file($user, $path);
return $code, $message if $code != 200;
( $code, $message ) = check_dexter_can_edit_file($path);
return $code, $message if $code != 200;
@ -388,10 +391,12 @@ sub user_delete_path ($user, $path) {
sub user_move_path_to_path ($user, $path, $new_path) {
my ( $code, $message ) = check_user_can_delete_file($user, $path);
return $code, $message if $code != 200;
( $code, $message ) = check_dexter_can_edit_file($path);
return $code, $message if $code != 200;
( $code, $message ) = check_user_can_create_file($user, $new_path);
return $code, $message if $code != 200;
( $code, $message ) = check_dexter_can_create_file($new_path);
return $code, $message if $code != 200;