Skip to content

Commit 552f866

Browse files
authored
Merge pull request #2194 from BEXIS2/rc
Rc -> dev -> 4.1.0
2 parents c8dd596 + 40aac11 commit 552f866

File tree

169 files changed

+11620
-5689
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+11620
-5689
lines changed

.github/workflows/codeql.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Advanced"
13+
14+
on:
15+
push:
16+
branches:
17+
- rc
18+
pull_request:
19+
branches:
20+
- rc
21+
schedule:
22+
- cron: '38 14 * * 4'
23+
24+
jobs:
25+
analyze:
26+
name: Analyze (${{ matrix.language }})
27+
# Runner size impacts CodeQL analysis time. To learn more, please see:
28+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
29+
# - https://gh.io/supported-runners-and-hardware-resources
30+
# - https://gh.io/using-larger-runners (GitHub.com only)
31+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
32+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
33+
permissions:
34+
# required for all workflows
35+
security-events: write
36+
37+
# required to fetch internal or private CodeQL packs
38+
packages: read
39+
40+
# only required for workflows in private repositories
41+
actions: read
42+
contents: read
43+
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
include:
48+
- language: actions
49+
build-mode: none
50+
- language: csharp
51+
build-mode: none
52+
- language: javascript-typescript
53+
build-mode: none
54+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
55+
# Use `c-cpp` to analyze code written in C, C++ or both
56+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
57+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
58+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
59+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
60+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
61+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
62+
steps:
63+
- name: Checkout repository
64+
uses: actions/checkout@v4
65+
66+
# Add any setup steps before running the `github/codeql-action/init` action.
67+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
68+
# or others). This is typically only required for manual builds.
69+
# - name: Setup runtime (example)
70+
# uses: actions/setup-example@v1
71+
72+
# Initializes the CodeQL tools for scanning.
73+
- name: Initialize CodeQL
74+
uses: github/codeql-action/init@v3
75+
with:
76+
languages: ${{ matrix.language }}
77+
build-mode: ${{ matrix.build-mode }}
78+
# If you wish to specify custom queries, you can do so here or in a config file.
79+
# By default, queries listed here will override any specified in a config file.
80+
# Prefix the list here with "+" to use these queries and those in the config file.
81+
82+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
83+
# queries: security-extended,security-and-quality
84+
85+
# If the analyze step fails for one of the languages you are analyzing with
86+
# "We were unable to automatically build your code", modify the matrix above
87+
# to set the build mode to "manual" for that language. Then modify this step
88+
# to build your code.
89+
# ℹ️ Command-line programs to run using the OS shell.
90+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
91+
- if: matrix.build-mode == 'manual'
92+
shell: bash
93+
run: |
94+
echo 'If you are using a "manual" build mode for one or more of the' \
95+
'languages you are analyzing, replace this with the commands to build' \
96+
'your code, for example:'
97+
echo ' make bootstrap'
98+
echo ' make release'
99+
exit 1
100+
101+
- name: Perform CodeQL Analysis
102+
uses: github/codeql-action/analyze@v3
103+
with:
104+
category: "/language:${{matrix.language}}"

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
steps:
1313
- name: Checkout repository
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
1515

1616
- name: Install .NET SDK
1717
uses: actions/setup-dotnet@v3

BExIS++.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1582,8 +1582,8 @@ Global
15821582
{9BFFFD11-03C6-47DF-9CC9-F458A9A49377} = {F3354AC7-CDA1-44E2-8E85-8DB532ED8C75}
15831583
EndGlobalSection
15841584
GlobalSection(ExtensibilityGlobals) = postSolution
1585-
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35;packages\Unity.2.1.505.2\lib\NET35
15861585
SolutionGuid = {9B6E4921-8EBA-487D-A098-3E473A0EAC64}
1586+
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35;packages\Unity.2.1.505.2\lib\NET35
15871587
EndGlobalSection
15881588
GlobalSection(SubversionScc) = preSolution
15891589
Svn-Managed = True

CITATION.cff

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
cff-version: 1.2.0
2+
message: "If you use BEXIS2 in your research, please cite it using the following metadata."
3+
title: "BEXIS2"
4+
version: 4.1.0
5+
date-released: 15.08.2025
6+
authors:
7+
- family-names: "Zander"
8+
given-names: "Franziska"
9+
orcid: "https://orcid.org/0000-0001-6892-7046"
10+
- family-names: "Schöne"
11+
given-names: "David"
12+
orcid: "https://orcid.org/0009-0009-4663-8716"
13+
- family-names: "Thiel"
14+
given-names: "Sven"
15+
orcid: "https://orcid.org/0000-0003-3093-5635"
16+
- family-names: "Hohmuth"
17+
given-names: "Martin"
18+
orcid: "https://orcid.org/0000-0001-7492-3631"
19+
- family-names: "König-Ries"
20+
given-names: "Birgitta"
21+
orcid: "https://orcid.org/0000-0002-2382-9722"
22+
doi: ..
23+
url: "https://github.com/BEXIS2/Core"
24+
license: "LGPL-3.0 license"
25+
type: software
26+
keywords:
27+
- research data management
28+
- data repository
29+
- data infrastructure
30+
- open source

Components/AAA/BExIS.Security.Services/Authentication/LdapAuthenticationManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace BExIS.Security.Services.Authentication
1212
{
13-
public class LdapAuthenticationManager
13+
public class LdapAuthenticationManager : IDisposable
1414
{
1515
private readonly IUnitOfWork _guow;
1616
private bool _isDisposed;

Components/AAA/BExIS.Security.Services/Authentication/SignInManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ namespace BExIS.Security.Services.Authentication
88
public sealed class SignInManager : SignInManager<User, long>
99
{
1010
[System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2000:Objekte verwerfen, bevor Bereich verloren geht", Justification = "<Ausstehend>")]
11-
public SignInManager(IAuthenticationManager authenticationManager)
12-
: base(new IdentityUserService(), authenticationManager)
11+
public SignInManager(IAuthenticationManager authenticationManager, UserManager userManager)
12+
: base(new IdentityUserService(userManager), authenticationManager)
1313
{
1414
}
1515
}

Components/AAA/BExIS.Security.Services/Subjects/GroupManager.cs

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using BExIS.Security.Entities.Subjects;
1+
using BExIS.Security.Entities.Authorization;
2+
using BExIS.Security.Entities.Subjects;
23
using BExIS.Utils.NH.Querying;
34
using Microsoft.AspNet.Identity;
45
using System;
@@ -116,6 +117,45 @@ public Task DeleteAsync(Group role)
116117
return Task.CompletedTask;
117118
}
118119

120+
public Task<bool> DeleteByIdAsync(long roleId)
121+
{
122+
var groupRepository = _guow.GetRepository<Group>();
123+
var group = groupRepository.Get(roleId);
124+
125+
if (group == null)
126+
//return Task.FromException(new Exception());
127+
return Task.FromResult(false);
128+
129+
130+
// Users
131+
var userRepository = _guow.GetRepository<User>();
132+
foreach (var user in group.Users)
133+
{
134+
user.Groups.Remove(group);
135+
userRepository.Put(user);
136+
}
137+
138+
// EntityPermissions
139+
var entityPermissionRepository = _guow.GetRepository<EntityPermission>();
140+
foreach (var entityPermission in entityPermissionRepository.Get(e => e.Subject.Id == roleId))
141+
{
142+
entityPermissionRepository.Delete(entityPermission);
143+
}
144+
145+
// FeaturePermissions
146+
var featurePermissionRepository = _guow.GetRepository<FeaturePermission>();
147+
foreach (var featurePermission in featurePermissionRepository.Get(e => e.Subject.Id == roleId))
148+
{
149+
featurePermissionRepository.Delete(featurePermission);
150+
}
151+
152+
var result = groupRepository.Delete(group);
153+
154+
_guow.Commit();
155+
156+
return Task.FromResult(result);
157+
}
158+
119159
public void Dispose()
120160
{
121161
this.Dispose(true);
Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,49 @@
11
using BExIS.Security.Entities.Subjects;
2+
using BExIS.Utils.NH.Querying;
23
using Microsoft.AspNet.Identity;
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Threading.Tasks;
37

48
namespace BExIS.Security.Services.Subjects
59
{
610
public class IdentityGroupService : RoleManager<Group, long>
711
{
8-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2000:Objekte verwerfen, bevor Bereich verloren geht", Justification = "<Ausstehend>")]
9-
public IdentityGroupService() : base(new GroupManager())
12+
private readonly GroupManager _groupManager;
13+
private bool _disposed;
14+
15+
//[System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2000:Objekte verwerfen, bevor Bereich verloren geht", Justification = "<Ausstehend>")]
16+
public IdentityGroupService(GroupManager groupManager) : base(groupManager)
1017
{
18+
_groupManager = groupManager ?? throw new ArgumentNullException(nameof(groupManager));
19+
1120
RoleValidator = new RoleValidator<Group, long>(this)
1221
{
1322
};
1423
}
1524

25+
public Task<bool> DeleteByIdAsync(long roleId)
26+
{
27+
return _groupManager.DeleteByIdAsync(roleId);
28+
}
29+
30+
public List<Group> GetGroups(FilterExpression filter, OrderByExpression orderBy, int pageNumber, int pageSize, out int count)
31+
{
32+
return _groupManager.GetGroups(filter, orderBy, pageNumber, pageSize, out count);
33+
}
1634
protected override void Dispose(bool disposing)
1735
{
36+
if (!_disposed)
37+
{
38+
if (disposing)
39+
{
40+
_groupManager?.Dispose();
41+
}
42+
43+
_disposed = true;
44+
}
45+
1846
base.Dispose(disposing);
19-
Store.Dispose();
2047
}
2148
}
2249
}

Components/AAA/BExIS.Security.Services/Subjects/IdentityUserService.cs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@ namespace BExIS.Security.Services.Subjects
99
{
1010
public class IdentityUserService : UserManager<User, long>
1111
{
12-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2000:Objekte verwerfen, bevor Bereich verloren geht", Justification = "<Ausstehend>")]
13-
public IdentityUserService() : base(new UserManager())
12+
private readonly UserManager _userManager;
13+
private bool _disposed;
14+
15+
//[System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2000:Objekte verwerfen, bevor Bereich verloren geht", Justification = "<Ausstehend>")]
16+
public IdentityUserService(UserManager userManager) : base(userManager)
1417
{
18+
_userManager = userManager;
19+
1520
// Configure validation logic for usernames
1621
UserValidator = new UserValidator<User, long>(this)
1722
{
@@ -54,8 +59,17 @@ public IdentityUserService() : base(new UserManager())
5459

5560
protected override void Dispose(bool disposing)
5661
{
62+
if (!_disposed)
63+
{
64+
if (disposing)
65+
{
66+
_userManager?.Dispose();
67+
}
68+
69+
_disposed = true;
70+
}
71+
5772
base.Dispose(disposing);
58-
Store.Dispose();
5973
}
6074
}
6175
}

Components/AAA/BExIS.Security.Services/Subjects/UserManager.cs

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using BExIS.Security.Entities.Authentication;
2+
using BExIS.Security.Entities.Authorization;
23
using BExIS.Security.Entities.Subjects;
34
using BExIS.Utils.NH.Querying;
45
using Microsoft.AspNet.Identity;
@@ -115,12 +116,34 @@ public Task DeleteAsync(User user)
115116
return Task.CompletedTask;
116117
}
117118

118-
public Task DeleteByIdAsync(long userId)
119+
public Task<bool> DeleteByIdAsync(long userId)
119120
{
120-
_guow.GetRepository<User>().Delete(userId);
121+
var userRepository = _guow.GetRepository<User>();
122+
var user = userRepository.Get(userId);
123+
124+
if(user == null)
125+
//return Task.FromException(new Exception());
126+
return Task.FromResult(false);
127+
128+
// EntityPermissions
129+
var entityPermissionRepository = _guow.GetRepository<EntityPermission>();
130+
foreach (var entityPermission in entityPermissionRepository.Get(e => e.Subject.Id == userId))
131+
{
132+
entityPermissionRepository.Delete(entityPermission);
133+
}
134+
135+
// FeaturePermissions
136+
var featurePermissionRepository = _guow.GetRepository<FeaturePermission>();
137+
foreach (var featurePermission in featurePermissionRepository.Get(e => e.Subject.Id == userId))
138+
{
139+
featurePermissionRepository.Delete(featurePermission);
140+
}
141+
142+
var result = userRepository.Delete(user);
143+
121144
_guow.Commit();
122145

123-
return Task.CompletedTask;
146+
return Task.FromResult(result);
124147
}
125148

126149
public void Dispose()

0 commit comments

Comments
 (0)