Skip to content

Ranger 5730: Restrict role import createNonExist flag to roles only - #1142

Open
eoinmcdonnell113 wants to merge 2 commits into
apache:masterfrom
eoinmcdonnell113:RANGER-5730
Open

Ranger 5730: Restrict role import createNonExist flag to roles only#1142
eoinmcdonnell113 wants to merge 2 commits into
apache:masterfrom
eoinmcdonnell113:RANGER-5730

Conversation

@eoinmcdonnell113

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

RANGER-5730: Restrict createNonExistUserGroupRole during role import so it creates missing nested roles only, and does not create missing users or groups.

Previously, importRolesFromFile with createNonExistUserGroupRole=true treated users, groups, and nested roles the same way. That forced creation of missing users/groups during role import, which is undesirable for large synced environments.

This change:

Splits create-missing behavior in RoleRefUpdater into separate controls for users/groups vs nested roles
Updates RoleREST.importRolesFromFile so createNonExistUserGroupRole=true means create missing nested roles only (createNonExistUserGroup=false)
Leaves existing create/update role API behavior (createNonExistUserGroup) unchanged

How was this patch tested?

Unit tests:

TestRoleRefUpdater — verifies missing users are not created when only role creation is enabled, and missing nested roles are scheduled for creation
TestRoleREST — verifies import passes (createNonExistUserGroup=false, createNonExistRole=true) when the import flag is true
TestRoleDBStore — existing create/update role coverage
Focused run result: TestRoleRefUpdater, TestRoleDBStore, and TestRoleREST — 102 tests passed (0 failures)

@eoinmcdonnell113 eoinmcdonnell113 changed the title Ranger 5730 Ranger 5730: Restrict role import createNonExist flag to roles only Aug 6, 2026
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