Skip to content

Commit

Permalink
Merge pull request #479 from Strongminds/release/12.0.4
Browse files Browse the repository at this point in the history
Release/12.0.4
  • Loading branch information
mrjsawdk authored Apr 12, 2023
2 parents 3f40bcf + 10e3ae5 commit cea4fb1
Show file tree
Hide file tree
Showing 473 changed files with 24,793 additions and 6,361 deletions.
2 changes: 1 addition & 1 deletion Core.ApplicationServices/AdviceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ private bool DispatchEmails(Advice advice)
else
{
var nameForNotification = advice.Name ?? "Ikke navngivet";
_userNotificationService.AddUserNotification(organizationIdOfRelatedEntityId.Value, advice.ObjectOwnerId.Value, nameForNotification, "Advis kunne ikke sendes da der ikke blev fundet nogen gyldig modtager. Dette kan skyldes at der ikke er nogen bruger tilknyttet den/de valgte rolle(r).", advice.RelationId.Value, advice.Type.Value, NotificationType.Advice);
_userNotificationService.AddUserNotification(organizationIdOfRelatedEntityId.Value, advice.ObjectOwnerId.Value, nameForNotification, "Advis kunne ikke sendes da der ikke blev fundet nogen gyldig modtager. Dette kan skyldes at der ikke er nogen bruger tilknyttet den/de valgte rolle(r).", advice.RelationId.Value, advice.Type, NotificationType.Advice);
}
}
return false;
Expand Down
14 changes: 14 additions & 0 deletions Core.ApplicationServices/Authorization/CommandPermissionResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Core.ApplicationServices.Authorization
{
public class CommandPermissionResult
{
public CommandPermissionResult(string id, bool canExecute)
{
Id = id;
CanExecute = canExecute;
}

public string Id { get; }
public bool CanExecute { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Core.DomainModel;

namespace Core.ApplicationServices.Authorization
{
public class ResourceCollectionPermissionsResult
{
public bool Create{ get; }

public ResourceCollectionPermissionsResult(bool create)
{
Create = create;
}

public static ResourceCollectionPermissionsResult FromOrganizationId<T>(
int organizationId,
IAuthorizationContext authorizationContext) where T : IEntity
{
return new ResourceCollectionPermissionsResult(authorizationContext.AllowCreate<T>(organizationId));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,19 @@ public static Result<ResourcePermissionsResult, OperationError> FromResolutionRe
IAuthorizationContext authorizationContext) where T : IEntity
{
return getEntityResult
.Select(entity => new ResourcePermissionsResult(true, authorizationContext.AllowModify(entity), authorizationContext.AllowDelete(entity)))
.Match<Result<ResourcePermissionsResult, OperationError>>
.Select(entity => FromEntity(entity, authorizationContext))
.Match
(
result => result,
error => error.FailureType == OperationFailure.Forbidden ? Empty : error
);
}

public static Result<ResourcePermissionsResult, OperationError> FromEntity<T>(
T entity,
IAuthorizationContext authorizationContext) where T : IEntity
{
return new ResourcePermissionsResult(true, authorizationContext.AllowModify(entity), authorizationContext.AllowDelete(entity));
}
}
}
59 changes: 57 additions & 2 deletions Core.ApplicationServices/Core.ApplicationServices.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@
<Compile Include="Authentication\AuthenticationMethod.cs" />
<Compile Include="Authentication\AuthenticationScope.cs" />
<Compile Include="Authentication\ApplicationAuthenticationState.cs" />
<Compile Include="Authorization\CommandPermissionResult.cs" />
<Compile Include="Generic\ExtendedExtendedEntityIdentityResolverService.cs" />
<Compile Include="Generic\IEntityIdMapper.cs" />
<Compile Include="Interface\Write\IItInterfaceWriteService.cs" />
<Compile Include="Interface\Write\ItInterfaceWriteService.cs" />
<Compile Include="Authorization\ResourceCollectionPermissionsResult.cs" />
<Compile Include="Model\Authentication\Commands\ValidateUserCredentialsCommand.cs" />
<Compile Include="Authentication\IAuthenticationContext.cs" />
<Compile Include="Authentication\IAuthenticationContextFactory.cs" />
<Compile Include="Authentication\IApplicationAuthenticationState.cs" />
Expand Down Expand Up @@ -145,6 +152,7 @@
<Compile Include="Model\Contracts\Write\ItContractProcurementModificationParameters.cs" />
<Compile Include="Model\Contracts\Write\ItContractSupplierModificationParameters.cs" />
<Compile Include="Model\Contracts\Write\ItContractTerminationParameters.cs" />
<Compile Include="Model\EventHandler\ValidateUserCredentialsCommandHandler.cs" />
<Compile Include="Model\GDPR\Write\SubDataProcessorParameter.cs" />
<Compile Include="Model\GDPR\Write\SubDataProcessor\SubDataProcessorDetailsParameters.cs" />
<Compile Include="Model\GDPR\Write\SubDataProcessor\TransferToInsecureCountryParameters.cs" />
Expand All @@ -153,21 +161,52 @@
<Compile Include="Model\GDPR\Write\UpdatedDataProcessingRegistrationOversightDataParameters.cs" />
<Compile Include="Model\GDPR\Write\UpdatedDataProcessingRegistrationOversightDate.cs" />
<Compile Include="Model\GDPR\Write\UpdatedDataProcessingRegistrationRoles.cs" />
<Compile Include="Model\Interface\ItInterfaceDataWriteModel.cs" />
<Compile Include="Model\Interface\ItInterfaceDeletionConflict.cs" />
<Compile Include="Model\Interface\ItInterfacePermissions.cs" />
<Compile Include="Model\Interface\ItInterfaceWriteModel.cs" />
<Compile Include="Model\Interface\ItInterfaceWriteModelParametersBase.cs" />
<Compile Include="Model\Messages\WritePublicMessagesParams.cs" />
<Compile Include="Model\Messages\PublicMessages.cs" />
<Compile Include="Model\Notification\EmailRecipientModel.cs" />
<Compile Include="Model\Notification\GlobalAdminNotification.cs" />
<Compile Include="Model\Notification\GlobalAdminNotificationMessage.cs" />
<Compile Include="Model\Notification\IHasBaseNotificationPropertiesModel.cs" />
<Compile Include="Model\Notification\IHasRecipientModels.cs" />
<Compile Include="Model\Notification\ImmediateNotificationModel.cs" />
<Compile Include="Model\Notification\NotificationPermissions.cs" />
<Compile Include="Model\Notification\Read\EmailRecipientResultModel.cs" />
<Compile Include="Model\Notification\Read\NotificationResultModel.cs" />
<Compile Include="Model\Notification\Read\RecipientResultModel.cs" />
<Compile Include="Model\Notification\Read\RoleRecipientResultModel.cs" />
<Compile Include="Model\Notification\RoleRecipientModel.cs" />
<Compile Include="Model\Notification\ScheduledNotificationModel.cs" />
<Compile Include="Model\Notification\BaseNotificationPropertiesModel.cs" />
<Compile Include="Model\Notification\RecipientModel.cs" />
<Compile Include="Model\Notification\UpdateScheduledNotificationModel.cs" />
<Compile Include="Model\Notification\Write\BaseNotificationPropertiesModificationParameters.cs" />
<Compile Include="Model\Notification\Write\EmailRecipientModificationParameters.cs" />
<Compile Include="Model\Notification\Write\IHasBaseNotificationPropertiesParameters.cs" />
<Compile Include="Model\Notification\Write\IHasReadonlyToDate.cs" />
<Compile Include="Model\Notification\Write\ImmediateNotificationModificationParameters.cs" />
<Compile Include="Model\Notification\Write\RoleRecipientModificationParameters.cs" />
<Compile Include="Model\Notification\Write\RootRecipientModificationParameters.cs" />
<Compile Include="Model\Notification\Write\CreateScheduledNotificationModificationParameters.cs" />
<Compile Include="Model\Notification\Write\UpdateScheduledNotificationModificationParameters.cs" />
<Compile Include="Model\Organizations\OrganizationUnitRegistrationChangeParameters.cs" />
<Compile Include="Model\Organizations\OrganizationRemovalConflicts.cs" />
<Compile Include="Model\Organizations\PaymentChangeParameters.cs" />
<Compile Include="Model\Organizations\StsOrganizationSynchronizationDetails.cs" />
<Compile Include="Model\Organizations\AuthorizedUpdateOrganizationFromFKOrganisationCommand.cs" />
<Compile Include="Model\RightsHolder\UserRoleAssociationDTO.cs" />
<Compile Include="Model\Shared\NamedEntityWithUuid.cs" />
<Compile Include="Model\Shared\OptionalValueChange.cs" />
<Compile Include="Model\Shared\Write\ExternalReferenceProperties.cs" />
<Compile Include="Model\SystemUsage\Write\NamedLink.cs" />
<Compile Include="Model\SystemUsage\Write\SystemRelationParameters.cs" />
<Compile Include="Model\SystemUsage\Write\SystemUsageCreationParameters.cs" />
<Compile Include="Model\SystemUsage\Write\SystemUsageJournalPeriod.cs" />
<Compile Include="Model\SystemUsage\Write\SystemUsageJournalPeriodProperties.cs" />
<Compile Include="Model\SystemUsage\Write\SystemUsageJournalPeriodUpdate.cs" />
<Compile Include="Model\SystemUsage\Write\SystemUsageUpdateParameters.cs" />
<Compile Include="Model\Shared\Write\UpdatedExternalReferenceProperties.cs" />
<Compile Include="Model\SystemUsage\Write\UpdatedSystemUsageGDPRProperties.cs" />
Expand All @@ -178,6 +217,10 @@
<Compile Include="Model\SystemUsage\Write\UpdatedSystemUsageRoles.cs" />
<Compile Include="Model\Shared\Write\UserRolePair.cs" />
<Compile Include="Model\System\RightsHolderSystemUpdateParameters.cs" />
<Compile Include="Model\System\SharedSystemUpdateParameters.cs" />
<Compile Include="Model\System\SystemDeletionConflict.cs" />
<Compile Include="Model\System\SystemPermissions.cs" />
<Compile Include="Model\System\SystemUpdateParameters.cs" />
<Compile Include="Model\Interface\RightsHolderItInterfaceUpdateParameters.cs" />
<Compile Include="Model\System\RightsHolderSystemCreationParameters.cs" />
<Compile Include="Model\UiCustomization\CustomUINodeParameters.cs" />
Expand All @@ -187,6 +230,12 @@
<Compile Include="Model\Users\UserRightsChangeParameters.cs" />
<Compile Include="Notification\GlobalAdminNotificationService.cs" />
<Compile Include="Notification\IGlobalAdminNotificationService.cs" />
<Compile Include="Notification\INotificationService.cs" />
<Compile Include="Notification\IRegistrationNotificationService.cs" />
<Compile Include="Notification\IRegistrationNotificationUserRelationsService.cs" />
<Compile Include="Notification\NotificationService.cs" />
<Compile Include="Notification\RegistrationNotificationService.cs" />
<Compile Include="Notification\RegistrationNotificationUserRelationsService.cs" />
<Compile Include="OptionTypes\IOptionResolver.cs" />
<Compile Include="OptionTypes\OptionsApplicationService.cs" />
<Compile Include="OptionTypes\IOptionsApplicationService.cs" />
Expand Down Expand Up @@ -234,6 +283,8 @@
<Compile Include="Organizations\OrganizationRightsService.cs" />
<Compile Include="ScheduledJobs\AdviceTrigger.cs" />
<Compile Include="ScheduledJobs\AdviceTriggerFactory.cs" />
<Compile Include="Shared\BoundedPaginationConstraints.cs" />
<Compile Include="Shared\CommandPermissionCommandIds.cs" />
<Compile Include="Shared\PagingContraints.cs" />
<Compile Include="SSO\Factories\ISsoStateFactory.cs" />
<Compile Include="SSO\Factories\SsoStateFactory.cs" />
Expand All @@ -260,6 +311,8 @@
<Compile Include="SSO\StsAdgangsStyringConstants.cs" />
<Compile Include="SystemUsage\GDPR\GDPRExportService.cs" />
<Compile Include="SystemUsage\GDPR\IGDPRExportService.cs" />
<Compile Include="SystemUsage\Migration\IItSystemUsageMigrationServiceAdapter.cs" />
<Compile Include="SystemUsage\Migration\ItSystemUsageMigrationServiceAdapter.cs" />
<Compile Include="SystemUsage\ReadModels\IItsystemUsageOverviewReadModelsService.cs" />
<Compile Include="SystemUsage\Relations\IItsystemUsageRelationsService.cs" />
<Compile Include="SystemUsage\IItSystemUsageService.cs" />
Expand Down Expand Up @@ -288,6 +341,8 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SingleThreadedMailClient.cs" />
<Compile Include="References\ReferenceService.cs" />
<Compile Include="System\Write\IItSystemWriteService.cs" />
<Compile Include="System\Write\ItSystemWriteService.cs" />
<Compile Include="Tracking\ITrackingService.cs" />
<Compile Include="Tracking\TrackingService.cs" />
<Compile Include="Users\Handlers\RemoveUserFromKitosCommandHandler.cs" />
Expand All @@ -306,7 +361,7 @@
<Name>Core.DomainModel</Name>
</ProjectReference>
<ProjectReference Include="..\Core.DomainServices\Core.DomainServices.csproj">
<Project>{adcacc1d-f538-464c-9102-f4c1d6fa35d3}</Project>
<Project>{ADCACC1D-F538-464C-9102-F4C1D6FA35D3}</Project>
<Name>Core.DomainServices</Name>
</ProjectReference>
<ProjectReference Include="..\Infrastructure.Services\Infrastructure.Services.csproj">
Expand Down
Loading

0 comments on commit cea4fb1

Please sign in to comment.