web/admin: clear other options depending on what the binding targets (#6703)
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
parent
6482a34af0
commit
f8489387ee
|
@ -77,6 +77,21 @@ export class PolicyBindingForm extends ModelForm<PolicyBinding, string> {
|
||||||
if (this.targetPk) {
|
if (this.targetPk) {
|
||||||
data.target = this.targetPk;
|
data.target = this.targetPk;
|
||||||
}
|
}
|
||||||
|
switch (this.policyGroupUser) {
|
||||||
|
case target.policy:
|
||||||
|
data.user = null;
|
||||||
|
data.group = null;
|
||||||
|
break;
|
||||||
|
case target.group:
|
||||||
|
data.policy = null;
|
||||||
|
data.user = null;
|
||||||
|
break;
|
||||||
|
case target.user:
|
||||||
|
data.policy = null;
|
||||||
|
data.group = null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
console.log(data);
|
||||||
if (this.instance?.pk) {
|
if (this.instance?.pk) {
|
||||||
return new PoliciesApi(DEFAULT_CONFIG).policiesBindingsUpdate({
|
return new PoliciesApi(DEFAULT_CONFIG).policiesBindingsUpdate({
|
||||||
policyBindingUuid: this.instance.pk,
|
policyBindingUuid: this.instance.pk,
|
||||||
|
|
Reference in a new issue