Skip to content

Commit

Permalink
finetune
Browse files Browse the repository at this point in the history
  • Loading branch information
seakayone committed Mar 4, 2024
1 parent 1680307 commit 3a25f22
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ final case class ProjectsResponderADMLive(
)
// create permissions for admins and members of the new group
_ <- createPermissionsForAdminsAndMembersOfNewProject(newProjectIRI)
_ <- projectService.setProjectRestrictedView(newProjectADM, RestrictedView.Size.default)
_ <- projectService.setProjectRestrictedView(newProjectADM, RestrictedView.default)

} yield ProjectOperationResponseADM(project = newProjectADM.unescape)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ import org.knora.webapi.slice.common.Value.BooleanValue
import org.knora.webapi.slice.common.Value.StringValue

sealed trait RestrictedView

object RestrictedView {

val default: RestrictedView = Size.default

final case class Watermark private (value: Boolean) extends RestrictedView with BooleanValue
object Watermark {
val On = Watermark(true)
val Off = Watermark(false)

val On: Watermark = Watermark(true)
val Off: Watermark = Watermark(false)

def from(value: Boolean): Watermark = if (value) On else Off
}

Expand All @@ -41,5 +46,4 @@ object RestrictedView {
case _ => Left(s"Invalid RestrictedViewSize: $value")
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ final case class ProjectADMService(

def setProjectRestrictedView(project: KnoraProject, settings: RestrictedView): Task[Unit] = {
val newSettings = settings match {
case RestrictedView.Watermark(false) => RestrictedView.Size.default
case RestrictedView.Watermark(false) => RestrictedView.default
case s => s
}
projectRepo.setProjectRestrictedView(project, newSettings)
Expand Down

0 comments on commit 3a25f22

Please sign in to comment.