Skip to content

Commit

Permalink
Fixes #24209: User sessions should contain the authorizations
Browse files Browse the repository at this point in the history
  • Loading branch information
clarktsiory committed Feb 20, 2024
1 parent 3320731 commit 2c582f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ object Rights {
}

def forAuthzs(authorizationTypes: AuthorizationType*): Rights = apply(authorizationTypes.toSeq)

def combineAll(rights: Iterable[Rights]): Rights = Rights(rights.map(_.authorizationTypes).toList.combineAll)
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package bootstrap.liftweb;

import com.normation.rudder.AuthorizationType;
import com.normation.rudder.domain.logger.ApplicationLogger;
import com.normation.rudder.users.*;
import org.apache.commons.logging.Log;
Expand Down Expand Up @@ -172,7 +173,7 @@ public Authentication authenticate(Authentication authentication)
JZioRuntime.runNow(userRepository.logStartSession(
details.getUsername(),
com.normation.rudder.Role.toDisplayNames(details.roles()),
details.roles().toList().flatMap(r -> r.rights().authorizationTypes().toList().map(a -> a.id())),
com.normation.rudder.Rights.combineAll(details.roles().toList().map(r -> r.rights())).authorizationTypes().toList().map(AuthorizationType::id),
com.normation.rudder.users.SessionId.apply(sessionId),
p.name(),
org.joda.time.DateTime.now()
Expand Down

0 comments on commit 2c582f4

Please sign in to comment.