+ bot + notifications

This commit is contained in:
xds
2025-04-01 15:07:50 +03:00
parent 711348b386
commit a38d5068e0
22 changed files with 603 additions and 129 deletions

View File

@@ -37,14 +37,9 @@ class SpaceService(
private val tagRepo: TagRepo
) {
suspend fun isValidRequest(spaceId: String): Space {
val securityContextHolder = ReactiveSecurityContextHolder.getContext().awaitSingleOrNull()
?: throw AuthException("Authentication failed")
val authentication = securityContextHolder.authentication
val username = authentication.name
// Получаем пользователя по имени
val user = userService.getByUsername(username)
suspend fun isValidRequest(spaceId: String, user: User): Space {
val space = getSpace(spaceId)
// Проверяем доступ пользователя к пространству