KC-1339: Fix nsf-share-folder team/user remove on NSF subfolders#2185
Open
sshrushanth-ks wants to merge 2 commits into
Open
KC-1339: Fix nsf-share-folder team/user remove on NSF subfolders#2185sshrushanth-ks wants to merge 2 commits into
sshrushanth-ks wants to merge 2 commits into
Conversation
Team recipients are now resolved via team_cache when absent from share_objects, @eXisting uses get_folder_access_v3 for subfolders, revoke verifies direct (non-inherited) accessors before calling access_update, and successful removes set sync_data and update the local access cache.
pvagare-ks
reviewed
Jul 2, 2026
| server_type = accessor.get('access_type') | ||
| if server_type: | ||
| access_type_label = server_type | ||
| access_type_enum = folder_pb2.AccessType.Value(server_type) |
Contributor
There was a problem hiding this comment.
folder_pb2.AccessType.Value(server_type) can raise on unexpected values. Wrap in try/except for a clearer error message.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nsf-share-folder -a removefailed on NSF subfolders due to incomplete team resolution and accessor lookup. This fix resolves teams from cache, loads accessors viaget_folder_access_v3, blocks inherited removes, and syncs local state after success.Changes
helpers.py— resolve team recipients fromteam_cachewhen missing fromshare_objectsfolder_commands.py—@existingusesget_folder_access_v3for subfolders; skips inherited accessors; setssync_dataon successfolder_api.py—revoke_folder_access_v3verifies direct access, uses server accessor UIDs, evicts cache, setssync_datacommon.py—parse_folder_access_resulttreatsSUCCESSwith a message as successtest_nested_share_folder.py— added subfolder remove/share tests; moved imports to top; added docstringstest_command_record.py— added docstring for folder JSON consistency test