Skip to content

Commit 60efbc2

Browse files
authored
Merge branch 'develop' into feature/skin-service
2 parents c70a8ba + 5430f97 commit 60efbc2

File tree

19 files changed

+600
-290
lines changed

19 files changed

+600
-290
lines changed

.github/workflows/updateVersions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- uses: actions/checkout@v4
1111

1212
- name: Get the release branch version
13-
uses: valadas/get-release-branch-version@v1.0.1
13+
uses: valadas/get-release-branch-version@v1.1.0
1414
id: branchVersion
1515

1616
- name: Set versions
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information
4+
5+
namespace DotNetNuke.Abstractions.Security.Permissions;
6+
7+
/// <summary>Information about the application of an instance of a folder permission.</summary>
8+
public interface IFolderPermissionInfo : IPermissionInfo
9+
{
10+
/// <summary>Gets or sets the ID of the folder permission.</summary>
11+
int FolderPermissionId { get; set; }
12+
13+
/// <summary>Gets or sets the folder ID to which the permission applies.</summary>
14+
int FolderId { get; set; }
15+
16+
/// <summary>Gets or sets the path of the folder to which the permission applies.</summary>
17+
string FolderPath { get; set; }
18+
19+
/// <summary>Gets or sets the portal ID of the folder to which the permission applies.</summary>
20+
int PortalId { get; set; }
21+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information
4+
5+
namespace DotNetNuke.Abstractions.Security.Permissions;
6+
7+
/// <summary>Information about the definition of a permission.</summary>
8+
public interface IPermissionDefinitionInfo
9+
{
10+
/// <summary>Gets or sets the Module Definition ID.</summary>
11+
public int ModuleDefId { get; set; }
12+
13+
/// <summary>Gets or sets the Permission Code.</summary>
14+
public string PermissionCode { get; set; }
15+
16+
/// <summary>Gets or sets the Permission ID.</summary>
17+
public int PermissionId { get; set; }
18+
19+
/// <summary>Gets or sets the Permission Key.</summary>
20+
public string PermissionKey { get; set; }
21+
22+
/// <summary>Gets or sets the Permission Name.</summary>
23+
public string PermissionName { get; set; }
24+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information
4+
5+
namespace DotNetNuke.Abstractions.Security.Permissions;
6+
7+
using System.Collections.Generic;
8+
9+
/// <summary>Handles the Business Control Layer for Permissions.</summary>
10+
public interface IPermissionDefinitionService
11+
{
12+
/// <summary>Gets the permissions.</summary>
13+
/// <returns>The permissions.</returns>
14+
IEnumerable<IPermissionDefinitionInfo> GetDefinitions();
15+
16+
/// <summary>Gets the permissions by folder.</summary>
17+
/// <returns>The permissions by folder.</returns>
18+
IEnumerable<IPermissionDefinitionInfo> GetDefinitionsByFolder();
19+
20+
/// <summary>Gets the permissions by desktop module.</summary>
21+
/// <returns>The permissions by desktop module.</returns>
22+
IEnumerable<IPermissionDefinitionInfo> GetDefinitionsByPortalDesktopModule();
23+
24+
/// <summary>Gets the permissions by tab.</summary>
25+
/// <returns>The permissions by tab.</returns>
26+
IEnumerable<IPermissionDefinitionInfo> GetDefinitionsByTab();
27+
28+
/// <summary>Gets the permissions by <see cref="IPermissionDefinitionInfo.PermissionCode"/> and <see cref="IPermissionDefinitionInfo.PermissionKey"/>.</summary>
29+
/// <param name="permissionCode">The permission code.</param>
30+
/// <param name="permissionKey">The permission key.</param>
31+
/// <returns>The permissions by tab.</returns>
32+
IEnumerable<IPermissionDefinitionInfo> GetDefinitionsByCodeAndKey(string permissionCode, string permissionKey);
33+
34+
/// <summary>Gets the permissions by <see cref="IPermissionDefinitionInfo.ModuleDefId"/>.</summary>
35+
/// <param name="moduleDefId">The module definition ID.</param>
36+
/// <returns>The permissions by tab.</returns>
37+
IEnumerable<IPermissionDefinitionInfo> GetDefinitionsByModuleDefId(int moduleDefId);
38+
39+
/// <summary>Gets the permissions by <see cref="IPermissionDefinitionInfo.ModuleDefId"/> and <see cref="IPermissionDefinitionInfo.PermissionCode"/> for the given module in the tab.</summary>
40+
/// <param name="moduleId">The module ID.</param>
41+
/// <param name="tabId">The tab ID.</param>
42+
/// <returns>The permissions by tab.</returns>
43+
IEnumerable<IPermissionDefinitionInfo> GetDefinitionsByModule(int moduleId, int tabId);
44+
45+
/// <summary>Adds a new permission.</summary>
46+
/// <param name="permissionDefinition">The permission.</param>
47+
/// <returns>The new permission ID.</returns>
48+
int AddDefinition(IPermissionDefinitionInfo permissionDefinition);
49+
50+
/// <summary>Deletes an existing permission.</summary>
51+
/// <param name="permissionDefinition">The permission to delete.</param>
52+
void DeleteDefinition(IPermissionDefinitionInfo permissionDefinition);
53+
54+
/// <summary>Gets the permission by the <see cref="IPermissionDefinitionInfo.PermissionId"/>.</summary>
55+
/// <param name="permissionDefinitionId">The permission ID.</param>
56+
/// <returns>The permission.</returns>
57+
IPermissionDefinitionInfo GetDefinition(int permissionDefinitionId);
58+
59+
/// <summary>Updates an existing permission.</summary>
60+
/// <param name="permission">The permission.</param>
61+
void UpdateDefinition(IPermissionDefinitionInfo permission);
62+
63+
/// <summary>Clears the permission definition cache.</summary>
64+
/// <remarks>
65+
/// <see cref="AddDefinition"/>, <see cref="UpdateDefinition"/> and <see cref="DeleteDefinition"/> will clear the cache automatically.
66+
/// This method is only needed if you want to clear the cache manually.
67+
/// </remarks>
68+
void ClearCache();
69+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information
4+
5+
namespace DotNetNuke.Abstractions.Security.Permissions;
6+
7+
/// <summary>Information about an applied instance of a permission.</summary>
8+
public interface IPermissionInfo : IPermissionDefinitionInfo
9+
{
10+
/// <summary>Gets or sets a value indicating whether gets and sets a flag that indicates whether the user or role has permission.</summary>
11+
bool AllowAccess { get; set; }
12+
13+
/// <summary>Gets or sets the User's DisplayName.</summary>
14+
string DisplayName { get; set; }
15+
16+
/// <summary>Gets or sets the Role ID.</summary>
17+
int RoleId { get; set; }
18+
19+
/// <summary>Gets or sets the Role Name.</summary>
20+
string RoleName { get; set; }
21+
22+
/// <summary>Gets or sets the User ID.</summary>
23+
int UserId { get; set; }
24+
25+
/// <summary>Gets or sets the User Name.</summary>
26+
string Username { get; set; }
27+
}

DNN Platform/Library/Security/Permissions/FolderPermissionCollection.cs

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
2-
// The .NET Foundation licenses this file to you under the MIT license.
3-
// See the LICENSE file in the project root for more information
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information
44
namespace DotNetNuke.Security.Permissions
55
{
66
using System;
77
using System.Collections;
88
using System.Collections.Generic;
9-
10-
using DotNetNuke.Common.Utilities;
11-
9+
10+
using DotNetNuke.Common.Utilities;
11+
1212
[Serializable]
1313
public class FolderPermissionCollection : CollectionBase
14-
{
15-
/// <summary>Initializes a new instance of the <see cref="FolderPermissionCollection"/> class.</summary>
14+
{
15+
/// <summary>Initializes a new instance of the <see cref="FolderPermissionCollection"/> class.</summary>
1616
public FolderPermissionCollection()
1717
{
18-
}
19-
20-
/// <summary>Initializes a new instance of the <see cref="FolderPermissionCollection"/> class.</summary>
21-
/// <param name="folderPermissions"></param>
18+
}
19+
20+
/// <summary>Initializes a new instance of the <see cref="FolderPermissionCollection"/> class.</summary>
21+
/// <param name="folderPermissions"></param>
2222
public FolderPermissionCollection(ArrayList folderPermissions)
2323
{
2424
this.AddRange(folderPermissions);
25-
}
26-
27-
/// <summary>Initializes a new instance of the <see cref="FolderPermissionCollection"/> class.</summary>
28-
/// <param name="folderPermissions"></param>
25+
}
26+
27+
/// <summary>Initializes a new instance of the <see cref="FolderPermissionCollection"/> class.</summary>
28+
/// <param name="folderPermissions"></param>
2929
public FolderPermissionCollection(FolderPermissionCollection folderPermissions)
3030
{
3131
this.AddRange(folderPermissions);
32-
}
33-
34-
/// <summary>Initializes a new instance of the <see cref="FolderPermissionCollection"/> class.</summary>
35-
/// <param name="folderPermissions"></param>
36-
/// <param name="folderPath"></param>
32+
}
33+
34+
/// <summary>Initializes a new instance of the <see cref="FolderPermissionCollection"/> class.</summary>
35+
/// <param name="folderPermissions"></param>
36+
/// <param name="folderPath"></param>
3737
public FolderPermissionCollection(ArrayList folderPermissions, string folderPath)
3838
{
3939
foreach (FolderPermissionInfo permission in folderPermissions)
@@ -91,6 +91,14 @@ public int Add(FolderPermissionInfo value, bool checkForDuplicates)
9191
return id;
9292
}
9393

94+
public void AddRange(IEnumerable<FolderPermissionInfo> folderPermissions)
95+
{
96+
foreach (var permission in folderPermissions)
97+
{
98+
this.List.Add(permission);
99+
}
100+
}
101+
94102
public void AddRange(ArrayList folderPermissions)
95103
{
96104
foreach (FolderPermissionInfo permission in folderPermissions)

0 commit comments

Comments
 (0)