Skip to content

Commit

Permalink
Do not update roles in the CSE edition
Browse files Browse the repository at this point in the history
If the role is not in shown on the page than
`get_security_userattrs` cannot find any set roles in the POST request
and stores 0 roles, removing any rights from the user. The POST request
is send when you change the set the password of an automation user and
save.

In the CSE we deactivated the option to change automation user roles by
choice. A common error of users is to misconfigure the default
automation users. That would lead to broken sites.

Change-Id: I2ee6b8fba701b2346d4ba07951087acf353e809e
  • Loading branch information
kain88-de committed Nov 17, 2023
1 parent 5a1f050 commit 3bd9c19
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmk/gui/wato/pages/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,9 +899,10 @@ def _get_security_userattrs(self, user_attrs: UserSpec) -> None:
user_attrs["serial"] = user_attrs.get("serial", 0) + 1

# Roles
user_attrs["roles"] = [
role for role in self._roles.keys() if html.get_checkbox("role_" + role)
]
if edition() != Edition.CSE:
user_attrs["roles"] = [
role for role in self._roles.keys() if html.get_checkbox("role_" + role)
]

def page(self) -> None: # pylint: disable=too-many-branches
# Let exceptions from loading notification scripts happen now
Expand Down

0 comments on commit 3bd9c19

Please sign in to comment.