Skip to content

Commit

Permalink
Refactoring: renamed userid to ownerid on stat-related code
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Oct 12, 2021
1 parent 016954a commit 8e99a26
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core/cs3iface.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def stat(endpoint, fileid, userid, versioninv=0):
inode = urlsafe_b64encode(statInfo.info.id.opaque_id.encode())
return {'inode': statInfo.info.id.storage_id + '-' + inode.decode(),
'filepath': statInfo.info.path,
'userid': statInfo.info.owner.opaque_id + '@' + statInfo.info.owner.idp,
'ownerid': statInfo.info.owner.opaque_id + '@' + statInfo.info.owner.idp,
'size': statInfo.info.size,
'mtime': statInfo.info.mtime.seconds
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/localiface.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def stat(_endpoint, filepath, _userid):
return {
'inode': str(statInfo.st_ino),
'filepath': filepath,
'userid': str(statInfo.st_uid) + ':' + str(statInfo.st_gid),
'ownerid': str(statInfo.st_uid) + ':' + str(statInfo.st_gid),
'size': statInfo.st_size,
'mtime': statInfo.st_mtime
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/wopi.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def checkFileInfo(fileid):
if acctok['viewmode'] in (utils.ViewMode.READ_ONLY, utils.ViewMode.READ_WRITE):
filemd['DownloadUrl'] = '%s?access_token=%s' % \
(srv.config.get('general', 'downloadurl'), flask.request.args['access_token'])
filemd['OwnerId'] = statInfo['userid']
filemd['OwnerId'] = statInfo['ownerid']
filemd['UserId'] = acctok['wopiuser'] # typically same as OwnerId; different when accessing shared documents
filemd['Size'] = statInfo['size']
# TODO the version is generated like this in ownCloud: 'V' . $file->getEtag() . \md5($file->getChecksum());
Expand Down
4 changes: 2 additions & 2 deletions src/core/xrootiface.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def statx(endpoint, filepath, userid, versioninv=0):
log.debug('msg="Invoked stat return" inode="%s" filepath="%s"' % (inode, _getfilepath(filepath)))
return {'inode': inode,
'filepath': filepath,
'userid': statxdata[5] + ':' + statxdata[6],
'ownerid': statxdata[5] + ':' + statxdata[6],
'size': int(statxdata[8]),
'mtime': int(statxdata[12])}
# now stat the corresponding version folder to get an inode invariant to save operations, see CERNBOX-1216
Expand Down Expand Up @@ -189,7 +189,7 @@ def statx(endpoint, filepath, userid, versioninv=0):
log.debug('msg="Invoked stat return" inode="%s" filepath="%s"' % (inode, _getfilepath(verFolder)))
return {'inode': inode,
'filepath': filepath,
'userid': statxdata[5] + ':' + statxdata[6],
'ownerid': statxdata[5] + ':' + statxdata[6],
'size': int(statxdata[8]),
'mtime': int(statxdata[12])}

Expand Down

0 comments on commit 8e99a26

Please sign in to comment.