Skip to content

Commit

Permalink
Added agent delegation call
Browse files Browse the repository at this point in the history
  • Loading branch information
flashingpumpkin committed Nov 8, 2017
1 parent 67c1122 commit 9b8dee8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/uk/gov/hmrc/epayeapi/controllers/ApiController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ trait ApiController extends BaseController with AuthorisedFunctions {
def EnrolmentsAction(enrolment: Enrolment, retrieveEnrolments: Retrieval[Enrolments])(action: Enrolments => EssentialAction): EssentialAction = {
EssentialAction { implicit request =>
Accumulator.done {
authorised(enrolment).retrieve(retrieveEnrolments) { enrolments =>
authorised(enrolment.withDelegatedAuthRule("epaye-auth"))
.retrieve(retrieveEnrolments) { enrolments =>
action(enrolments)(request).run()
} recoverWith {
case ex: MissingBearerToken => missingBearerToken
Expand Down

0 comments on commit 9b8dee8

Please sign in to comment.