Skip to content

Commit

Permalink
negate the property names for data type creation and deletion (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
HauklandJ authored Sep 5, 2024
1 parent da2c498 commit 1f3a8ed
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions src/Storage.Interface/Models/ApplicationLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ public class ApplicationLogic
public bool AutoDeleteOnProcessEnd { get; set; }

/// <summary>
/// Specifies whether users should be able to create data of this type.
/// Specifies whether users should be unable to create data of this type.
/// Defaults to false if not specified.
/// </summary>
[JsonProperty(PropertyName = "allowUserCreate")]
public bool AllowUserCreate { get; set; }
[JsonProperty(PropertyName = "disallowUserCreate")]
public bool DisallowUserCreate { get; set; }

/// <summary>
/// Specifies whether users should be able to delete data of this type.
/// Specifies whether users should be unable to delete data of this type.
/// Defaults to false if not specified.
/// </summary>
[JsonProperty(PropertyName = "allowUserDelete")]
public bool AllowUserDelete { get; set; }
[JsonProperty(PropertyName = "disallowUserDelete")]
public bool DisallowUserDelete { get; set; }

/// <summary>
/// Specifies whether the data type is compatible with sub form usage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"appLogic": {
"autoCreate": true,
"classRef": "Altinn.App.Models.StarteBedrift",
"allowUserCreate": true,
"allowUserDelete": true,
"disallowUserCreate": false,
"disallowUserDelete": false,
"allowInSubform": true
},
"taskId": "Task_1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"appLogic": {
"autoCreate": true,
"classRef": "Altinn.App.Models.StarteBedrift",
"allowUserCreate": true,
"allowUserDelete": true
"disallowUserCreate": false,
"disallowUserDelete": false
},
"taskId": "Task_1",
"maxCount": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ public void MetadataWithoutShadowFields_ShouldBeFalse()
{
Application applicationBefore = TestdataHelper.LoadDataFromEmbeddedResourceAsType<Application>("AllowUserActions.applicationMetadata_beforeChange.json");

applicationBefore.DataTypes.First(d => d.Id == "Veileder").AppLogic.AllowUserCreate.Should().BeFalse();
applicationBefore.DataTypes.First(d => d.Id == "Veileder").AppLogic.AllowUserDelete.Should().BeFalse();
applicationBefore.DataTypes.First(d => d.Id == "Veileder").AppLogic.DisallowUserCreate.Should().BeFalse();
applicationBefore.DataTypes.First(d => d.Id == "Veileder").AppLogic.DisallowUserDelete.Should().BeFalse();
}

[Fact]
public void MetadataWithShadowFields_ShouldBeTrue()
{
Application applicationBefore = TestdataHelper.LoadDataFromEmbeddedResourceAsType<Application>("AllowUserActions.applicationMetadata_afterChange.json");

applicationBefore.DataTypes.First(d => d.Id == "Veileder").AppLogic.AllowUserCreate.Should().BeTrue();
applicationBefore.DataTypes.First(d => d.Id == "Veileder").AppLogic.AllowUserDelete.Should().BeTrue();
applicationBefore.DataTypes.First(d => d.Id == "Veileder").AppLogic.DisallowUserCreate.Should().BeTrue();
applicationBefore.DataTypes.First(d => d.Id == "Veileder").AppLogic.DisallowUserDelete.Should().BeFalse();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"appLogic": {
"autoCreate": true,
"classRef": "Altinn.App.Models.StarteBedrift",
"allowUserCreate": true,
"allowUserDelete": true
"disallowUserCreate": true,
"disallowUserDelete": false
},
"taskId": "Task_1",
"maxCount": 1,
Expand Down

0 comments on commit 1f3a8ed

Please sign in to comment.