Skip to content

KC-1361: Reject share commands that target a record or folder owner#2243

Merged
sk-keeper merged 1 commit into
releasefrom
share-commands-fix
Jul 23, 2026
Merged

KC-1361: Reject share commands that target a record or folder owner#2243
sk-keeper merged 1 commit into
releasefrom
share-commands-fix

Conversation

@sshrushanth-ks

Copy link
Copy Markdown
Contributor

Summary
Sharing a record or folder to its owner via share-record, share-folder, nsf-share-record, or nsf-share-folder treated the owner like a normal share recipient. Grant, update, and revoke against the owner are invalid because the owner already has full access. These commands now detect that case early and fail with a clear message instead of sending a confusing or no-op share request. Ownership transfer (share-record -a owner) still works, but transferring to someone who already owns the record is rejected as a no-op.

Changes
register.py — added owner lookup helpers; share-record and share-folder now reject grant/revoke (and grant on folders) when the target is the owner; bulk user updates also skip the folder owner
helpers.py — added shared NSF owner checks and raise_if_record_share_target_is_owner
sharing_commands.py / folder_commands.py — wired the same owner rejection into nsf-share-record and nsf-share-folder
record_api.py — added find_record_owner_username for NSF record owner resolution
test_command_register.py / test_nested_share_folder.py — added tests covering grant-to-owner rejection and self ownership-transfer rejection

…2235)

* Reject share commands that target a record or folder owner.

Fail early with a clear message for share-record, share-folder,
nsf-share-record, and nsf-share-folder so owners are not granted,
updated, or revoked as if they were share recipients.

* resolved review comments

* addressed logging and variable naming comments
@sshrushanth-ks
sshrushanth-ks marked this pull request as ready for review July 23, 2026 13:28
@sshrushanth-ks sshrushanth-ks self-assigned this Jul 23, 2026
@sk-keeper
sk-keeper merged commit 9aed9bf into release Jul 23, 2026
4 checks passed
@sk-keeper
sk-keeper deleted the share-commands-fix branch July 23, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants