feat: role-based feature visibility — App Profiles + Platform Profiles - #2668
Closed
ppatel9703 wants to merge 3 commits into
Closed
feat: role-based feature visibility — App Profiles + Platform Profiles#2668ppatel9703 wants to merge 3 commits into
ppatel9703 wants to merge 3 commits into
Conversation
…rm Profiles) Part A — App Profiles: - AbstractSecurityUtils: 4 new tables (APP_PROFILE, APP_FEATURE, APP_PROFILE_FEATURE, APP_USER_PROFILE) bootstrapped in initialize() - AppProfileUtils: full CRUD for profiles, features, profile-feature assignments, user-profile assignments, and feature evaluation (checkFeature, getUserFeatures — enabled-only, fail-closed) - 16 reactors in prerna.reactor.appprofile covering all Pixel operations - SecurityProjectUtils: cascade deleteUserProfile calls in removeProjectUser, removeExpiredProjectUser, and removeProjectUsers to prevent stale assignments Part B — Platform Profiles: - AbstractSecurityUtils: 3 new tables (PLATFORM_PROFILE, PLATFORM_PROFILE_FEATURE, PLATFORM_USER_PROFILE) - PlatformProfileUtils: CRUD for platform profiles, predefined nav-key feature toggles, user assignments, and getUserFeatures (fail-open for unassigned users) - 9 reactors in prerna.reactor.platformprofile Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
getProfiles() and getFeatures() used SelectQueryStruct/WrapperManager which performs OWL metadata lookups. APP_PROFILE and APP_FEATURE are not registered in SEMOSS's schema, so getPhysicalPropertyNameFromConceptualName returns null causing NPE during SQL composition. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add getPlatformProfileUsers() to PlatformProfileUtils — queries PLATFORM_USER_PROFILE for all users assigned to a given profile - Add GetPlatformProfileUsersReactor (admin-only) so the admin UI Members tab can list users assigned to each platform profile Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
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.
Description
Implements a two-part Role-Based Feature Visibility system from scratch. The system has two independent parts:
"Profile" is intentionally distinct from SEMOSS's existing "role" concept (owner/editor/viewer). Roles control what a user can do; profiles control what a user sees.
Changes Made
New Utility Classes
src/prerna/auth/utils/AppProfileUtils.java— All DB operations for app-level profiles, features, and user-profile assignments. Cascade delete fromSecurityProjectUtilsensuresAPP_USER_PROFILErows are cleaned up whenever a user loses app access.src/prerna/auth/utils/PlatformProfileUtils.java— All DB operations for platform-level profiles and nav feature toggles. Validates feature keys against a predefined set (nav.app-catalog,nav.build,nav.skills,nav.settings,nav.engine).Security DB Schema (AbstractSecurityUtils.java)
7 new tables added to
initialize()using the existingcreateTableIfNotExistspattern:APP_PROFILE,APP_FEATURE,APP_PROFILE_FEATURE,APP_USER_PROFILEPLATFORM_PROFILE,PLATFORM_PROFILE_FEATURE,PLATFORM_USER_PROFILEApp Profile Reactors (
src/prerna/reactor/appprofile/)16 reactors covering full CRUD for profiles, features, profile-feature assignment, and user-profile assignment:
CreateAppProfileapp,name,description,isDefaultUpdateAppProfileapp,profileId,name,description,isDefaultDeleteAppProfileapp,profileIdGetAppProfilesapp*CreateAppFeatureapp,key,descriptionUpdateAppFeatureapp,featureId,key,descriptionDeleteAppFeatureapp,featureIdGetAppFeaturesapp*SetProfileFeatureapp,profileId,featureId,enabledGetProfileFeaturesapp,profileIdAssignUserProfileapp,userId,profileId*RemoveUserProfileapp,userIdGetUserProfileapp,userIdGetProfileUsersapp,profileIdCheckFeatureapp,featureKeyGetUserFeaturesapp*Platform Profile Reactors (
src/prerna/reactor/platformprofile/)10 reactors (all admin-only):
CreatePlatformProfilename*,descriptionUpdatePlatformProfileprofileId*,name,descriptionDeletePlatformProfileprofileId* (rejects if users assigned)GetPlatformProfilesSetPlatformFeatureprofileId,featureKey,enabled*GetPlatformFeaturesprofileId*AssignUserPlatformProfileuserId,profileIdRemoveUserPlatformProfileuserId*GetUserPlatformFeaturesGetPlatformProfileUsersprofileId*SecurityProjectUtils.java
Added
AppProfileUtils.removeUserProfile(appId, userId)at every code path that removes a user from a project — ensures no staleAPP_USER_PROFILErows after access revocation.How to Test
App Profiles — end-to-end
Platform Profiles
Delete protection
Cascade delete (access revocation)
Remove a user from an app via existing security mechanisms and verify the
APP_USER_PROFILErow is also gone:Notes
^[a-zA-Z0-9\-]+$, max 100 chars, server-side. Platform feature keys are a closed predefined set.export-csvin App A and App B are separate rows with separate UUIDs.