We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a17405 commit 5a12271Copy full SHA for 5a12271
nc_py_api/files/__init__.py
@@ -282,12 +282,13 @@ class FilePermissions(enum.IntFlag):
282
"""Access to re-share object(s)"""
283
284
285
-def permissions_to_str(permissions: int, is_dir: bool = False) -> str:
+def permissions_to_str(permissions: int | str, is_dir: bool = False) -> str:
286
"""Converts integer permissions to string permissions.
287
288
:param permissions: concatenation of ``FilePermissions`` integer flags.
289
:param is_dir: Flag indicating is permissions related to the directory object or not.
290
"""
291
+ permissions = int(permissions) if not isinstance(permissions, int) else permissions
292
r = ""
293
if permissions & FilePermissions.PERMISSION_SHARE:
294
r += "R"
0 commit comments