Skip to content

Commit

Permalink
1624: Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ztefanie committed Nov 27, 2024
1 parent ced9c12 commit 4487008
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
1 change: 1 addition & 0 deletions administration/src/project-configs/showcase/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const config: ProjectConfig = {
applicationFeature: {
applicationJsonToPersonalData,
applicationJsonToCardQuery,
applicationUsableWithApiToken: true,
},
staticQrCodesEnabled: false,
card: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import app.ehrenamtskarte.backend.common.webservice.KOBLENZ_PASS_PROJECT
import app.ehrenamtskarte.backend.projects.database.ProjectEntity
import app.ehrenamtskarte.backend.projects.database.Projects
import app.ehrenamtskarte.backend.regions.database.RegionEntity
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
import org.jetbrains.exposed.sql.select
import org.jetbrains.exposed.sql.transactions.transaction

object Authorizer {
Expand Down Expand Up @@ -58,7 +56,7 @@ object Authorizer {

fun mayViewUsersInRegion(user: AdministratorEntity?, region: RegionEntity): Boolean {
return (user?.role == Role.REGION_ADMIN.db_value && user.regionId == region.id) ||
mayViewUsersInProject(user, region.projectId.value)
mayViewUsersInProject(user, region.projectId.value)
}

fun maySendMailsInRegion(user: AdministratorEntity, regionId: Int): Boolean {
Expand Down Expand Up @@ -157,13 +155,13 @@ object Authorizer {
fun mayAddApiTokensInProject(user: AdministratorEntity): Boolean {
return transaction {
(
user.role == Role.PROJECT_ADMIN.db_value && ProjectEntity.find { Projects.project eq KOBLENZ_PASS_PROJECT }
user.role == Role.PROJECT_ADMIN.db_value && ProjectEntity.find { Projects.project eq KOBLENZ_PASS_PROJECT }
.single().id.value == user.projectId.value
) ||
(
user.role == Role.EXTERNAL_VERIFIED_API_USER.db_value && ProjectEntity.find { Projects.project eq EAK_BAYERN_PROJECT }
.single().id.value == user.projectId.value
) ||
(
user.role == Role.EXTERNAL_VERIFIED_API_USER.db_value && ProjectEntity.find { Projects.project eq EAK_BAYERN_PROJECT }
.single().id.value == user.projectId.value
)
)
}
}

Expand All @@ -177,7 +175,7 @@ object Authorizer {
return transaction {
ProjectEntity.find { Projects.project eq KOBLENZ_PASS_PROJECT }
.single().id.value == user.projectId.value &&
user.role == Role.PROJECT_ADMIN.db_value
user.role == Role.PROJECT_ADMIN.db_value
}
}
}

0 comments on commit 4487008

Please sign in to comment.