Change lightfinder permissions for groups
This commit is contained in:
@@ -995,11 +995,11 @@ public partial class LightlessHub
|
||||
return false;
|
||||
}
|
||||
|
||||
var (isOwner, _) = await TryValidateOwner(dto.GID).ConfigureAwait(false);
|
||||
var (isOwner, _) = await TryValidateGroupModeratorOrOwner(dto.GID).ConfigureAwait(false);
|
||||
if (!isOwner)
|
||||
{
|
||||
_logger.LogCallWarning(LightlessHubLogger.Args("Unauthorized syncshell broadcast change", "User", UserUID, "GID", dto.GID));
|
||||
await Clients.Caller.Client_ReceiveServerMessage(MessageSeverity.Error, "You must be the owner of the syncshell to broadcast it.");
|
||||
await Clients.Caller.Client_ReceiveServerMessage(MessageSeverity.Error, "You must be the owner or moderator of the syncshell to broadcast it.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -216,6 +216,7 @@ public class ServerFilesController : ControllerBase
|
||||
{
|
||||
hash = hash.ToUpperInvariant();
|
||||
}
|
||||
|
||||
var existingFile = await dbContext.Files.SingleOrDefaultAsync(f => f.Hash == hash);
|
||||
if (existingFile != null) return Ok();
|
||||
|
||||
@@ -273,6 +274,7 @@ public class ServerFilesController : ControllerBase
|
||||
{
|
||||
hash = hash.ToUpperInvariant();
|
||||
}
|
||||
|
||||
var existingFile = await dbContext.Files.SingleOrDefaultAsync(f => f.Hash == hash);
|
||||
if (existingFile != null) return Ok();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user