mirror of
https://github.com/bitwarden/server.git
synced 2025-07-09 03:43:51 -05:00
[PM-11123] Service layer for Notification Center (#4741)
* PM-11123: Service layer * PM-11123: Service layer for Notification Center * PM-11123: Throw error on unsupported requirement * PM-11123: Missing await * PM-11123: Cleanup * PM-11123: Unit Test coverage * PM-11123: Flipping the authorization logic to be exact match of fail, formatting * PM-11123: Async warning * PM-11123: Using AuthorizeOrThrowAsync, removal of redundant set new id * PM-11123: UT typo * PM-11123: UT fix
This commit is contained in:
@ -0,0 +1,19 @@
|
||||
#nullable enable
|
||||
using Microsoft.AspNetCore.Authorization.Infrastructure;
|
||||
|
||||
namespace Bit.Core.NotificationCenter.Authorization;
|
||||
|
||||
public class NotificationStatusOperationsRequirement : OperationAuthorizationRequirement
|
||||
{
|
||||
public NotificationStatusOperationsRequirement(string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
}
|
||||
|
||||
public static class NotificationStatusOperations
|
||||
{
|
||||
public static readonly NotificationStatusOperationsRequirement Read = new(nameof(Read));
|
||||
public static readonly NotificationStatusOperationsRequirement Create = new(nameof(Create));
|
||||
public static readonly NotificationStatusOperationsRequirement Update = new(nameof(Update));
|
||||
}
|
Reference in New Issue
Block a user