Create users on the frontend, without 'administer users' permission As you may know, there's one single permission that controls user's access to other user's creation - permission is called 'administer users'. It either gives access to full user's administration or to nothing.

On my system I have tiered users who are supposed to have some permissions in relation to user administration. But not all permissions. I basically need to be able to create user accounts (based on profile2) on the frontend url (not /admin/people/p2rp-create/user but eg. /add-user.

I know there's a way of rendering an existing Drupal registration form, not sure how to
a) render profile2 form, or, to be precise, render profile2 form that includes forms for few created profile (I have 3 at the moment)
b) make it create a user even tho user doesn't have 'administer user'

I played with the following for starters

function module_menu(){
  $items['add-user'] = array(
  'title' =&gt; 'Add user',
  'page callback' =&gt; 'module_reg_form',
  'access arguments' =&gt; array('access create customer'),
 );

function module_reg_form(){
  $user_register_form = drupal_get_form('user_register_form');
  $form_state = array('profiles' =&gt; array('contact_details'));
  $registration_with_profile_fields_form = profile2_attach_form($user_register_form, $form_state);
  print(drupal_render($user_register_form));
}


This throws an error

EntityMalformedException: Missing bundle property on entity of type profile2. in entity_extract_ids() (line 7721 of /home/dreamweddings/www/dreamweddings.eu/public/includes/common.inc).
Can you not simply give user permissions to create users of specific roles (via the administerusersbyrole module) and then use the existing user creation form at /admin/people/create? If you do go with administerusersbyrole, make sure you follow the two steps on the project page for assigning the configuration.

If you must have a custom form via another page, you probably want to do it via a proper form definition function by setting the menu 'page callback' to 'drupal_get_form', and then passing the function that provides the form definition in 'page arguments'. See this particular comment for a code example. This way you'll be able to do proper form validation and a for submit handler too. Even if you get your current snippet working, the form still needs to submit somewhere to work.