title: How to convert joomla(ACL) from joomla 1.5 to joomla 2.5 version
body: <p>I have a function in joomla 1.5</p>
  
  <pre><code>function saveuser($row){
      $db =&amp; JFactory::getDBO();
      $instance = new JUser();
      jimport('joomla.application.component.helper');
      $config   = &amp;JComponentHelper::getParams('com_users');
      if(!isset($row['usertype']))
      $row['usertype'] = $config-&gt;get( 'new_usertype', 'Registered' );
  
      $acl =&amp; JFactory::getACL();
      if(!$row['gid'])
      $row['gid'] = $acl-&gt;get_group_id( '', $usertype);
  
      $instance-&gt;set( 'id'            , $row['id'] );
      $instance-&gt;set( 'name'          , $row['name'] );
      $instance-&gt;set( 'username'      , $row['username'] );
      $instance-&gt;set( 'password'      , $row['password'] );
      $instance-&gt;set( 'email'         , $row['email'] );
      $instance-&gt;set( 'gid'           , $row['gid']);
      $instance-&gt;set( 'usertype'      , $row['usertype'] );
      unset($instance-&gt;password_clear);
      unset($instance-&gt;guest);
      unset($instance-&gt;aid);
      $ret = $db-&gt;insertObject( '#__users', $instance, 'id' );
      if(!$ret){
          return false;
      }
      $acl-&gt;add_object( 'users', $row['username'], $row['id'], null, null, 'ARO' );
      $acl-&gt;add_group_object( $row['gid'], 'users', $row['id'], 'ARO' );
      return true;
  }
  </code></pre>
  
  <p>But when run as joomla 2.5 is error is:</p>
  
  <pre><code>Fatal error: Call to undefined method JAccess::get_group_id() in ... on line ...
  Fatal error: Call to undefined method JAccess::add_object() in ... on line ...
  Fatal error: Call to undefined method JAccess::add_group_object() ... on line ...
  
  How to fix this function to joomla 2.5, How to ideas ?
  </code></pre>