Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DisallowUserInstantiation property on Application to prevent manual instantiation of instances #426

Merged
merged 5 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ root = true
#### Naming styles ####

[*.cs]

end_of_line = lf
tab_width = 4
indent_size = 4

# Naming rules

dotnet_naming_rule.private_or_internal_field_should_be_begins_with__.severity = suggestion
Expand Down Expand Up @@ -91,9 +96,6 @@ dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
indent_size = 4
end_of_line = crlf
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
Expand Down
6 changes: 6 additions & 0 deletions src/Storage.Interface/Models/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ public class Application : ChangableElement

public CopyInstanceSettings CopyInstanceSettings { get; set; }

/// <summary>
/// Gets or sets the instantiation config of the app.
/// </summary>
[JsonProperty(PropertyName = "instantiation")]
public InstantiationConfig Instantiation { get; set; }

/// <inheritdoc/>
public override string ToString()
{
Expand Down
16 changes: 16 additions & 0 deletions src/Storage.Interface/Models/InstantiationConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Newtonsoft.Json;

namespace Altinn.Platform.Storage.Interface.Models
{
/// <summary>
/// Configuration related to instantiations in an app.
/// </summary>
public class InstantiationConfig
{
/// <summary>
/// Gets or sets a property indicating whether manual instantiation is disabled.
/// </summary>
[JsonProperty(PropertyName = "manualInstantiationDisabled")]
public bool ManualInstantiationDisabled { get; set; }
}
}
13 changes: 7 additions & 6 deletions src/Storage.Interface/Models/PartyTypesAllowed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,33 @@
namespace Altinn.Platform.Storage.Interface.Models
{
/// <summary>
/// Represents an set of settings where application owner can define what types of parties
/// that are allowed to instantiate an application.
/// Represents a set of settings where application owner can define what types of parties
/// that are allowed to be owners of an instance in an application.
/// </summary>
/// <remarks>If all values are set to false (the default), then all types are allowed as owners</remarks>
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
public class PartyTypesAllowed
{
/// <summary>
/// Gets or sets a value indicating whether a bankruptcy estate is allowed to instantiate.
/// Gets or sets a value indicating whether a bankruptcy estate is allowed to be the owner of an instance.
/// </summary>
[JsonProperty(PropertyName = "bankruptcyEstate")]
public bool BankruptcyEstate { get; set; }

/// <summary>
/// Gets or sets a value indicating whether an organisation is allowed to instantiate.
/// Gets or sets a value indicating whether an organisation is allowed to be the owner of an instance.
/// </summary>
[JsonProperty(PropertyName = "organisation")]
public bool Organisation { get; set; }

/// <summary>
/// Gets or sets a value indicating whether a person is allowed to instantiate.
/// Gets or sets a value indicating whether a person is allowed to be the owner of an instance.
/// </summary>
[JsonProperty(PropertyName = "person")]
public bool Person { get; set; }

/// <summary>
/// Gets or sets a value indicating whether a sub unit is allowed to instantiate.
/// Gets or sets a value indicating whether a sub unit is allowed to be the owner of an instance.
/// </summary>
[JsonProperty(PropertyName = "subUnit")]
public bool SubUnit { get; set; }
Expand Down
Loading