Vojtech Szocs has submitted this change and it was merged.

Change subject: userportal: Improve login process
......................................................................


userportal: Improve login process

This patch improves the common login infrastructure (BaseApplicationInit)
and implements UserPortal-specific logic that gets executed after successful
login (calling UserPortalLoginModel.UpdateIsENGINEUser method, and updating
UI according to "IsENGINEUser" property value).

Summary of changes:

1. Refactored BaseApplicationInit login-related methods.
   Added login model type parameter to BaseApplicationInit.

2. UserPortal ApplicationInit: instead of performing the actual UI
   login operation immediately after UserPortalLoginModel fires its
   LoggedInEvent, we call UserPortalLoginModel.UpdateIsENGINEUser method
   to determine user type. After we receive user type information (async
   callback), we store it into CurrentUserRole, which is a singleton
   object used to hold user role information. Then we proceed with the
   actual login operation.

   CurrentUserRole impacts the default place of the "main" section:
   - for user with isEngineUser==true,
     default "main" place is "Basic" main tab
   - for user with isEngineUser==false,
     default "main" place is "Extended" main tab

   CurrentUserRole also impacts "main" section UI:
   - for user with isEngineUser==true, the main tab panel is hidden
     (user has only access to "Basic" main tab content)
   - for user with isEngineUser==false, the main tab panel is visible
     (user has access to both "Basic" and "Extended" main tab content)

   This is a direct analogy to how original UserPortal handles user
   login and adapts UI according to "isEngineUser" user role information.

3. UserPortal now has its own specific place manager. This is required
   because UserPortal has two different default "main" section places,
   depending on the current user role. After the user logs in, place
   manager ensures that he is properly redirected to appropriate default
   "main" section place.

4. Created LoggedInExtendedPlaceGatekeeper that protects "main" section
   places within the "Extended" main tab.

   Gatekeeper strategy in UserPortal is following:
   - LoggedInExtendedPlaceGatekeeper is the default gatekeeper
   - LoginSectionPresenter (#login) uses @NoGatekeeper as usual
   - MainTabBasicPresenter (#basic) uses @UseGatekeeper
     with standard LoggedInGatekeeper

   This properly protects "Extended" main tab places from being accessed
   by unauthorized users (users with isEngineUser==false), even if they
   manipulate application URL.

Change-Id: I9933d03dba77efa0f51212c93619c433f343a5da
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/gin/BaseSystemModule.java
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/place/ApplicationPlaceManager.java
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/system/BaseApplicationInit.java
A 
frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/auth/CurrentUserRole.java
A 
frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/auth/LoggedInExtendedPlaceGatekeeper.java
M 
frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/gin/ClientGinjector.java
M 
frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/gin/SystemModule.java
M 
frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/place/ApplicationPlaces.java
A 
frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/place/UserPortalPlaceManager.java
A 
frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/DefaultMainSectionExtendedPlace.java
M 
frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/presenter/HeaderPresenterWidget.java
M 
frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/presenter/tab/MainTabBasicPresenter.java
M 
frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/view/HeaderView.java
M 
frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/system/ApplicationInit.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/SystemModule.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/place/ApplicationPlaces.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/system/ApplicationInit.java
17 files changed, 244 insertions(+), 44 deletions(-)

Approvals:
  Vojtech Szocs: Verified; Looks good to me, approved


--
To view, visit http://gerrit.ovirt.org/2843
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9933d03dba77efa0f51212c93619c433f343a5da
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vojtech Szocs <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Danny Rankevich <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Vojtech Szocs <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to