-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
Priority: HighAfter critical issues are fixed, these should be dealt with before any further issues.After critical issues are fixed, these should be dealt with before any further issues.bug(fix)Something isn't working or address a specific issue or vulnerabilitySomething isn't working or address a specific issue or vulnerabilityhelp wantedExtra attention is neededExtra attention is needed
Description
The isInvald()
respectively vfunc
-parameter to BaseBone is incomplete and broken.
This is what I wanted to achieve:
roles = SelectBone(
descr=i18n.translate("viur.user.bone.roles", defaultText="Roles"),
values=conf["viur.user.roles"],
required=True,
multiple=True,
vfunc=lambda values:
i18n.translate(
"user.bone.roles.invalid",
defaultText="Invalid role setting: 'custom' can only be set alone.")
if "custom" in values and len(values) > 1 else None,
defaultValue=list(conf["viur.user.roles"].keys())[0],
)
There are multiple problems here:
- vfunc/isInvalid() is generally not implemented for
SelectBone
- The vfunc/isInvalid()-function in
StringBone
is implemented on single values only - In this case, I want to verify the complete bone value and reject, if it contains "custom" as the role name, as "custom" may only be used separately as a special role. It's impossible to fix this.
That's all for now.
Metadata
Metadata
Assignees
Labels
Priority: HighAfter critical issues are fixed, these should be dealt with before any further issues.After critical issues are fixed, these should be dealt with before any further issues.bug(fix)Something isn't working or address a specific issue or vulnerabilitySomething isn't working or address a specific issue or vulnerabilityhelp wantedExtra attention is neededExtra attention is needed