[backend/core] Disallow following of system users
This commit is contained in:
parent
df26db0585
commit
4cfd4de389
3 changed files with 4 additions and 2 deletions
|
@ -124,7 +124,7 @@ public class User : IEntity
|
|||
[Column("isBot")]
|
||||
public bool IsBot { get; set; }
|
||||
|
||||
[Column("isSystem")] public bool IsSystem { get; set; }
|
||||
[Column("isSystem")] public bool IsSystemUser { get; set; }
|
||||
|
||||
[Column("isRelayActor")] public bool IsRelayActor { get; set; }
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ public class SystemUserService(ILogger<SystemUserService> logger, DatabaseContex
|
|||
IsLocked = true,
|
||||
IsExplorable = false,
|
||||
IsBot = true,
|
||||
IsSystem = true
|
||||
IsSystemUser = true
|
||||
};
|
||||
|
||||
var userKeypair = new UserKeypair
|
||||
|
|
|
@ -660,6 +660,8 @@ public class UserService(
|
|||
throw GracefulException.UnprocessableEntity("You cannot follow yourself");
|
||||
if (follower.IsRemoteUser && followee.IsRemoteUser)
|
||||
throw GracefulException.UnprocessableEntity("Cannot process follow between two remote users");
|
||||
if (follower.IsSystemUser || followee.IsSystemUser)
|
||||
throw GracefulException.UnprocessableEntity("System users cannot have follow relationships");
|
||||
|
||||
Guid? relationshipId = null;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue