@@ -97,12 +97,6 @@ async function is_user_signup_disabled() {
9797}
9898
9999const chkperm = spanify ( 'chkperm' , async ( target_fsentry , requester_user_id , action ) => {
100- // TODO (xiaochen): remove this branch after the related ACL permission logic is implemented for "MemoryFSProvider".
101- if ( target_fsentry . is_public ) {
102- console . log ( 'TRUE BECAUSE IS_PUBLIC' )
103- // return true;
104- }
105-
106100 // basic cases where false is the default response
107101 if ( ! target_fsentry )
108102 return false ;
@@ -978,7 +972,7 @@ const body_parser_error_handler = (err, req, res, next) => {
978972 * TODO (xiaochen): It only works for MemoryFSProvider currently.
979973 *
980974 * @param {string } uid - The uid of the file to get.
981- * @returns {Promise<FileInfo |null> } The file node, or null if the file does not exist.
975+ * @returns {Promise<MemoryFile |null> } The file node, or null if the file does not exist.
982976 */
983977async function get_entry ( uid ) {
984978 const svc_mountpoint = Context . get ( 'services' ) . get ( 'mountpoint' ) ;
@@ -996,14 +990,10 @@ async function get_entry(uid) {
996990}
997991
998992async function is_ancestor_of ( ancestor_uid , descendant_uid ) {
999- console . log ( 'is_ancestor_of' , ancestor_uid , descendant_uid ) ;
1000-
1001993 const ancestor = await get_entry ( ancestor_uid ) ;
1002994 const descendant = await get_entry ( descendant_uid ) ;
1003995
1004996 if ( ancestor && descendant ) {
1005- console . log ( 'ancestor' , ancestor ) ;
1006- console . log ( 'descendant' , descendant ) ;
1007997 return descendant . path . startsWith ( ancestor . path ) ;
1008998 }
1009999
@@ -1028,11 +1018,6 @@ async function is_ancestor_of(ancestor_uid, descendant_uid){
10281018 let parent = await db . read ( "SELECT `uuid`, `parent_uid` FROM `fsentries` WHERE `uuid` = ? LIMIT 1" , [ descendant_uid ] ) ;
10291019 if ( parent [ 0 ] === undefined )
10301020 parent = await db . pread ( "SELECT `uuid`, `parent_uid` FROM `fsentries` WHERE `uuid` = ? LIMIT 1" , [ descendant_uid ] ) ;
1031-
1032- if ( ! parent [ 0 ] ?. uuid ) {
1033- console . log ( 'parent[0].uuid is undefined' , parent [ 0 ] ) ;
1034- }
1035-
10361021 if ( parent [ 0 ] . uuid === ancestor_uid || parent [ 0 ] . parent_uid === ancestor_uid ) {
10371022 return true ;
10381023 }
0 commit comments