Skip to content

Commit a5fd1b0

Browse files
Allow guest users from trial orgas (#8772)
Adds orgas with a trial plan to orgas that pay for their users, meaning they can become guests in other orgas. ### URL of deployed dev instance (used for testing): - https://___.webknossos.xyz ### Steps to test: - I suggest manually testing. But I already did this, and as it is quite the hassle, I'd say no additional testing is needed ### Issues: - fixes https://scm.slack.com/archives/C5AKLAV0B/p1752133546847139 ------ (Please delete unneeded items, merge only when none are left open) - [x] Added changelog entry (create a `$PR_NUMBER.md` file in `unreleased_changes` or use `./tools/create-changelog-entry.py`) --------- Co-authored-by: Florian M <fm3@users.noreply.github.com>
1 parent 0141211 commit a5fd1b0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app/models/user/User.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ case class UserCompactInfo(
9191

9292
class UserDAO @Inject()(sqlClient: SqlClient)(implicit ec: ExecutionContext)
9393
extends SQLDAO[User, UsersRow, Users](sqlClient) {
94+
private val PricingPlansAllowingGuestsQuery =
95+
q"""(${PricingPlan.Team}, ${PricingPlan.Power}, ${PricingPlan.Custom}, ${PricingPlan.Team_Trial}, ${PricingPlan.Power_Trial})"""
9496
protected val collection = Users
9597

9698
protected def idColumn(x: Users): Rep[String] = x._Id
@@ -217,7 +219,7 @@ class UserDAO @Inject()(sqlClient: SqlClient)(implicit ec: ExecutionContext)
217219
AND _organization IN (
218220
SELECT _id
219221
FROM webknossos.organizations
220-
WHERE pricingPlan IN ('Team', 'Power', 'Custom')
222+
WHERE pricingPlan IN $PricingPlansAllowingGuestsQuery
221223
)
222224
ORDER BY _multiUser, created ASC
223225
)
@@ -403,7 +405,7 @@ class UserDAO @Inject()(sqlClient: SqlClient)(implicit ec: ExecutionContext)
403405
AND NOT isDeactivated
404406
AND _organization IN (
405407
SELECT _id FROM webknossos.organizations
406-
WHERE pricingPlan IN (${PricingPlan.Team}, ${PricingPlan.Power}, ${PricingPlan.Custom})
408+
WHERE pricingPlan IN $PricingPlansAllowingGuestsQuery
407409
)
408410
ORDER BY created ASC
409411
LIMIT 1""".as[ObjectId])

unreleased_changes/8772.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
### Changed
2+
- Users of organizations with a trial pricing plan can now join other organizations as guests.

0 commit comments

Comments
 (0)