Skip to content

Commit

Permalink
Fixes #13026: Removing workflow comet leads to missing user informati…
Browse files Browse the repository at this point in the history
…on and session is destroyed
  • Loading branch information
fanf committed Jul 24, 2018
1 parent 6fb797b commit 9ce04be
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ object RudderConfig extends Loggable {
, xmlUnserializer
, sectionSpecParser
)
lazy val asyncWorkflowInfo = new AsyncWorkflowInfo
lazy val workflowService: FacadeWorkflowService = FacadeWorkflowService(
new NoWorkflowServiceImpl(
commitAndDeployChangeRequest
Expand Down Expand Up @@ -750,6 +749,7 @@ object RudderConfig extends Loggable {
// Internal APIs
val sharedFileApi = new SharedFilesAPI(restExtractorService,RUDDER_DIR_SHARED_FILES_FOLDER)

lazy val asyncWorkflowInfo = new AsyncWorkflowInfo
lazy val configService: ReadConfigService with UpdateConfigService = {
new LDAPBasedConfigService(
config
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@ class Authz extends DispatchSnippet with Loggable {


def dispatch = {
case "render" => testRight
case "whennorights" => whenNoRights
case "render" => testRight
case "whennorights" => whenNoRights
case "whenhasrights" => whenHasRights
}


/*
* Check if no authorizations are defined for the
* current user - having even one "no_rights"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,27 @@ package com.normation.rudder.web.snippet
import net.liftweb.http.DispatchSnippet
import com.normation.plugins.SpringExtendableSnippet
import com.normation.plugins.SnippetExtensionKey
import com.normation.rudder.domain.logger.ApplicationLogger
import com.normation.rudder.web.model.CurrentUser

import scala.xml.NodeSeq

class CommonLayout extends DispatchSnippet with SpringExtendableSnippet[CommonLayout] {
def extendsAt = SnippetExtensionKey(classOf[CommonLayout].getSimpleName)

def mainDispatch = Map(
"display" -> { x:NodeSeq => x},
"display" -> init
)

/*
* This seems to be needed in top of common layout to correctly init
* the session var just after login.
*/
def init(xml: NodeSeq): NodeSeq = {
CurrentUser.get match {
case None => ApplicationLogger.warn("Authz.init called but user not authenticated")
case Some(_) => //expected
}
xml
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@

</head>
<body data-lift="CommonLayout.display" class="skin-yellow sidebar-mini">

<div class="tw-bs">
<div class="wrapper">
<header class="main-header">
Expand Down Expand Up @@ -299,11 +298,9 @@ <h4 class="panel-title">
</div>

<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<!-- Change request -->
<li class="lift:comet?type=WorkflowInformation" name="workflowInfo" ></li>
<!-- Promise Generation -->
<li class="lift:comet?type=AsyncDeployment" name="deploymentStatus"></li>
<ul class="nav navbar-nav" id="rudder-navbar">
<!-- Promise Generation -->
<li class="lift:comet?type=AsyncDeployment" name="deploymentStatus"></li>
<li class="tasks-menu">
<a target="_blank" href="/rudder-doc">
<i class="fa fa-book"></i>
Expand Down

0 comments on commit 9ce04be

Please sign in to comment.