I have a simple application using the Play! framework’s secure module. My ‘Users’ controller extends CRUD and is protected by @Check(‘admin’), so users have to be admins to access CRUD methods. However, I’d like anyone to be able to create new Users– like a “Sign Up” or “Register” button.
What is a good way to do this, given that all of my Users methods except Create should be protected? Can I apply @Check(“admin”) to individual methods?
Here is my Users controller:
package controllers;
import play.*;
import play.mvc.*;
@Check("admin")
@With(Secure.class)
public class Users extends CRUD {
};
What is a good way to do this, given that all of my Users methods except Create should be protected?
Can I apply @Check("admin") to individual methods?