In Motorprise, only users who have admin rights within their organization can view and use the Company Admin pages. These users were assigned an admin role when they were created by a Motorprise administrator. When a user logs into Motorprise, we check to see if he or she has admin rights to the parent organization.

We used the atg/userdirectory/droplet/HasFunction component in the page fragment MotorpriseJSP/j2ee-apps/motorprise/web-app/en/common/BrandNav.jsp to check if the user who logged in is an admin. This fragment is used on MotorpriseJSP/j2ee-apps/motorprise/web-app/en/home.jsp.

Two input parameters are passed to HasFunction. It takes the ID of the user who is logged in as userId. It also checks to see if a function of admin exists for that user and renders a true output if it does.

Here is the code fragment from BrandNav.jsp:

<!--  display link if user has admin role -->
<dsp:droplet name="HasFunction">
  <dsp:param bean="Profile.id" name="userId"/>
  <dsp:param name="function" value="admin"/>
  <dsp:oparam name="true">
    <dsp:droplet name="Switch">
      <dsp:param bean="Profile.currentLocation" name="value"/>
      <dsp:oparam name="admin">
        <td align="center"><dsp:a href="../admin/business_units.jsp">
        <b><font color="#FDD30E" size=-1>Company
          Admin</font></b></dsp:a></td>
      </dsp:oparam>
      <dsp:oparam name="default">
        <td align="center"><dsp:a href="../admin/business_units.jsp">
        <b><font color="#FFFFFF" size=-1>Company
          Admin</font></b></dsp:a></td>
      </dsp:oparam>
    </dsp:droplet>
  </dsp:oparam>
</dsp:droplet>

If the user has a function of admin, the “Company Admin” link is displayed on the home page, thereby giving him or her access to the admin pages. The following screen shot shows a home page for Mary Granger from USMW with a company admin link:

If the user is not an admin, the “Company Admin” link is not displayed and the user does not have access to the Company Admin pages. The following screen shot shows a home page for Ron Blooming from USMW without a company admin link:

After an administrator logs in with a valid user name and password and selects Company Admin, the Business Units page is displayed. This page lists all of the business units that the user has access to administer. He or she can either select one of these units or create a new business unit.

 
loading table of contents...