* Initial stab at how this could look * Authorization PoC wip * Add connection manager * Add DI to its own class * Use enum instead of string * Use groups * Refactor group management into its own service * Update a users groups when it's saved * Add saved events * Wire up deleted notifications * Ensure update date and create date is the same * Cleanup * Minor cleanup * Remove unusued usings * Move route to constant * Add docstrings to server event router * Fix and suppress warnings * Refactor to authorizer pattern * Update EventType * Remove unused enums * Add trashed events * Notify current user that they've been updated * Add broadcast We don't need it, but seems like a thing that a server event router should be able to do. * Add ServerEventRouterTests * Add ServerEventUserManagerTests * Use TimeProvider * Remove principal null check * Don't assign event type * Minor cleanup * Rename AuthorizedEventSources * Change permission for relations * Exctract event authorization into its own service * Add some tests * Update name * Add forgotten file * Rmember to add to DI
25 lines
838 B
C#
25 lines
838 B
C#
using System.Security.Claims;
|
|
|
|
namespace Umbraco.Cms.Core.ServerEvents;
|
|
|
|
/// <summary>
|
|
/// Manages group access for a user.
|
|
/// </summary>
|
|
public interface IServerEventUserManager
|
|
{
|
|
/// <summary>
|
|
/// Adds the connections to the groups that the user has access to.
|
|
/// </summary>
|
|
/// <param name="user">The owner of the connection.</param>
|
|
/// <param name="connectionId">The connection to add to groups.</param>
|
|
/// <returns></returns>
|
|
Task AssignToGroupsAsync(ClaimsPrincipal user, string connectionId);
|
|
|
|
/// <summary>
|
|
/// Reauthorize the user and removes all connections held by the user from groups they are no longer allowed to access.
|
|
/// </summary>
|
|
/// <param name="user">The user to reauthorize.</param>
|
|
/// <returns></returns>
|
|
Task RefreshGroupsAsync(ClaimsPrincipal user);
|
|
}
|