-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/origin/master'
- Loading branch information
Showing
107 changed files
with
1,699 additions
and
6,234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
infra/schema/src/main/java/com/evolveum/midpoint/schema/config/ExpressionConfigItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Copyright (C) 2010-2023 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
|
||
package com.evolveum.midpoint.schema.config; | ||
|
||
import com.evolveum.midpoint.util.exception.ConfigurationException; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ExecutionPrivilegesSpecificationType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ExpressionType; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class ExpressionConfigItem | ||
extends ConfigurationItem<ExpressionType> | ||
implements PrivilegesMixin<ExpressionType> { | ||
|
||
@SuppressWarnings("unused") // called dynamically | ||
public ExpressionConfigItem(@NotNull ConfigurationItem<ExpressionType> original) { | ||
super(original); | ||
} | ||
|
||
private ExpressionConfigItem(@NotNull ExpressionType value, @NotNull ConfigurationItemOrigin origin) { | ||
super(value, origin); | ||
} | ||
|
||
public static ExpressionConfigItem embedded(@NotNull ExpressionType bean) { | ||
return of(bean, ConfigurationItemOrigin.embedded(bean)); | ||
} | ||
|
||
public static ExpressionConfigItem of(@NotNull ExpressionType bean, @NotNull ConfigurationItemOrigin origin) { | ||
return new ExpressionConfigItem(bean, origin); | ||
} | ||
|
||
public static ExpressionConfigItem of( | ||
@NotNull ExpressionType bean, | ||
@NotNull OriginProvider<? super ExpressionType> originProvider) { | ||
return new ExpressionConfigItem(bean, originProvider.origin(bean)); | ||
} | ||
|
||
// TODO remove | ||
// public @Nullable ObjectReferenceType getRunAsRef() throws ConfigurationException { | ||
// var value = value(); | ||
// var privileges = value.getPrivileges(); | ||
// var legacyRunAsRef = value.getRunAsRef(); | ||
// if (privileges != null) { | ||
// if (legacyRunAsRef != null) { | ||
// throw new ConfigurationException( | ||
// "Both privileges and legacy runAsRef are present in " + fullDescription()); | ||
// } else { | ||
// return privileges.getRunAsRef(); | ||
// } | ||
// } else { | ||
// return legacyRunAsRef; | ||
// } | ||
// } | ||
|
||
public @Nullable ExecutionPrivilegesSpecificationType getPrivileges() throws ConfigurationException { | ||
return getPrivileges( | ||
value().getRunAsRef(), | ||
value().getPrivileges()); | ||
} | ||
|
||
public boolean isAllowEmptyValues() { | ||
return Boolean.TRUE.equals(value().isAllowEmptyValues()); | ||
} | ||
|
||
public boolean isTrace() { | ||
return Boolean.TRUE.equals(value().isTrace()); | ||
} | ||
} |
Oops, something went wrong.