Search code examples
playframeworkplayframework-2.3securesocial

Make startSignUp Action private in securesocial 3.0-M3/master.snapshot with Play 2.3x


I made a custom Registration controller similar to the default Registration controller:

class Registration(override implicit val env: RuntimeEnvironment[BasicProfile]) extends medRegistration[BasicProfile]

with

trait medRegistration[U] extends BaseRegistration[U] {
  ...
  override def startSignUp = Action {
    ...
  }

How can I secure startSignUp, since I only want the admin to be able to sign up users, but want the user to be able to complete the signUp process by mailToken.

I have my working standard constraints for normal actions:

SecuredAction(WithRole("admin"))

But I can't get it to work here.


Solution

  • I just made another controller, with new startsignup and starthandlesignup Actions. I had to copy handleStartResult and createToken from MailtokenBasedOperations though.