Skip to content

Commit

Permalink
Merge pull request #393 from noharm-ai/develop
Browse files Browse the repository at this point in the history
remove role lock
  • Loading branch information
marceloarocha authored Oct 16, 2024
2 parents 44edf23 + a106399 commit 3bcd5cd
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions services/user_admin_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,20 +204,12 @@ def upsert_user(data: dict, user_context: User, user_permissions: List[Permissio
)

if updatedUser.config != None:
current_roles = updatedUser.config.get("roles", [])
current_features = updatedUser.config.get("features", [])

updatedUser.name = data.get("name", None)
updatedUser.external = data.get("external", None)
updatedUser.active = bool(data.get("active", True))

if not _has_valid_roles(current_roles):
raise ValidationError(
"Este usuário não pode ser editado.",
"errors.businessRules",
status.HTTP_400_BAD_REQUEST,
)

updatedUser.config = {"roles": new_roles}
if Permission.ADMIN_USERS in user_permissions:
updatedUser.config["features"] = new_features
Expand Down

0 comments on commit 3bcd5cd

Please sign in to comment.