Skip to content

Commit

Permalink
Revert "change permission check for preview and admin to ONLY log…
Browse files Browse the repository at this point in the history
… for now (rather than 403) - reverting this commit will follow in a sep. PR"

This reverts commit 8da0eb5.
  • Loading branch information
twrichards committed May 20, 2024
1 parent 0ccefb2 commit d4cac86
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions common/app/http/GuardianAuthWithExemptions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import common.Environment.stage
import conf.Configuration.aws.mandatoryCredentials
import model.ApplicationContext
import org.apache.pekko.stream.Materializer
import org.slf4j.LoggerFactory
import play.api.Mode
import play.api.libs.ws.WSClient
import play.api.mvc._
Expand All @@ -35,8 +34,6 @@ class GuardianAuthWithExemptions(

private val outer = this

val logger = LoggerFactory.getLogger(this.getClass)

private val permissions: PermissionsProvider = PermissionsProvider(
PermissionsConfig(
stage = if (stage == "PROD") "PROD" else "CODE",
Expand Down Expand Up @@ -105,14 +102,12 @@ class GuardianAuthWithExemptions(
if (permissions.hasPermission(requiredPermission, user.email)) {
nextFilter(request)
} else {
// Future.successful(
// Results.Forbidden(
// s"You do not have permission to access $system. " +
// s"You should contact Central Production to request '$requiredEditorialPermissionName' permission.",
// ),
// )
logger.warn(s"${user.email} used $system, but didn't have '$requiredEditorialPermissionName' permission.")
nextFilter(request)
Future.successful(
Results.Forbidden(
s"You do not have permission to access $system. " +
s"You should contact Central Production to request '$requiredEditorialPermissionName' permission.",
),
)
}
}
}
Expand Down

0 comments on commit d4cac86

Please sign in to comment.