How to create a account with a password set as a fixture in the server

I need to create a admin account so i am giving one accounts id the ability to post and remove comments. How do i set the password and id. Or what is a better way of doing this. thanks.

Hi, I’m not quite sure what you’re looking to accomplish. Is it:

  • have an admin user, who enabled other users, and
  • have regular users, who can comment if the admin user enables them?

If that’s the case, you’ll want to add a package that implements user roles (or do it yourself). Whenever you write a function that only an admin should be able to call, check that the calling user is actually an admin. Of course, you’ll want to do these checks server-side.

Make sense?