Improved server share permission handling and share ui

This commit is contained in:
2025-07-24 20:19:49 +02:00
parent 1f94752c54
commit 431cdcb260
19 changed files with 270 additions and 151 deletions

View File

@@ -9,6 +9,7 @@ using MoonCore.Models;
using Moonlight.ApiServer.Database.Entities;
using MoonlightServers.ApiServer.Database.Entities;
using MoonlightServers.ApiServer.Extensions;
using MoonlightServers.ApiServer.Mappers;
using MoonlightServers.ApiServer.Models;
using MoonlightServers.ApiServer.Services;
using MoonlightServers.Shared.Constants;
@@ -153,7 +154,7 @@ public class ServersController : Controller
Share = new()
{
SharedBy = owners.First(y => y.Id == x.Server.OwnerId).Username,
Permissions = x.Content.Permissions
Permissions = ShareMapper.MapToPermissionLevels(x.Content)
}
}).ToArray();
@@ -223,7 +224,7 @@ public class ServersController : Controller
response.Share = new()
{
SharedBy = owner.Username,
Permissions = authorizationResult.Share.Content.Permissions
Permissions = ShareMapper.MapToPermissionLevels(authorizationResult.Share.Content)
};
}