Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions modules/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,12 @@ def addSkel(self):
else:
# An admin tries to add a new user.
self.extendAccessRights(skel)

# Unlock and require a password
skel.password.required = True
skel.password.visible = True
skel.password.readOnly = False
if "password" in skel:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can the password bone not be in that skel? It's calling the underlying prototypes/list.py:addSkel, which in turn calls self._resolveSkelCls. None of these can / should mess with the skeleton.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This happens in a case where my project does not use the Username-Password-method, but Google user and another login method.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue is now over one year old. Can you please apply it? Under several reasons, a password bone is not available in different projects.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any inputs from others?
I don't mind if we merge this as it won't break anything, but in my opinion you are doing something wrong if you can trigger this. My preferred method would be setting the bone to visible=False and readOnly=True instead of removing it from the predefined skeleton. These bones are there for a reason, you remove parententry from hierarchySkels things will fall apart similarly.

skel.password.required = True
skel.password.visible = True
skel.password.readOnly = False

skel.name.readOnly = False # Dont enforce readonly name in user/add
return skel
Expand Down