Skip to content

Commit

Permalink
Merge branch '8.0-next' into 8.1-next
Browse files Browse the repository at this point in the history
  • Loading branch information
VinceMacBuche committed Mar 11, 2024
2 parents 8f525f6 + 221825e commit 176934b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ class UserManagementApiImpl(

implicit def transformDbUserToJsonUser(implicit userInfo: UserInfo): Transformer[UserSession, JsonUser] = {
// Filter out custom permissions of form "anon[..]" and take the aliased roles of form "alias(role)" (see toDisplayNames)
def getDiplayPermissions(userSession: UserSession): JsonRoles = {
def getDisplayPermissions(userSession: UserSession): JsonRoles = {
val customRegex = """^anon\[(.*)\]$""".r
val aliasedRegex = """^.*\((.*)\)$""".r
JsonRoles(userSession.permissions.flatMap {
Expand All @@ -573,8 +573,8 @@ class UserManagementApiImpl(
.define[UserSession, JsonUser]
.withFieldConst(_.id, userInfo.id)
.withFieldComputed(_.authz, s => JsonRights(s.authz.toSet))
.withFieldComputed(_.roles, getDiplayPermissions(_))
.withFieldComputed(_.rolesCoverage, getDiplayPermissions(_))
.withFieldComputed(_.roles, getDisplayPermissions(_))
.withFieldComputed(_.rolesCoverage, getDisplayPermissions(_))
.withFieldConst(_.name, userInfo.name)
.withFieldConst(_.email, userInfo.email)
.withFieldConst(_.otherInfo, userInfo.otherInfo)
Expand All @@ -587,7 +587,7 @@ class UserManagementApiImpl(
userInfo.managedBy -> JsonProviderInfo(
userInfo.managedBy,
JsonRights(s.authz.toSet),
getDiplayPermissions(s),
getDisplayPermissions(s),
JsonRights.empty
)
)
Expand Down

0 comments on commit 176934b

Please sign in to comment.