Show TOC Start of Content Area

Procedure documentation Creating the Permission Class for the Web Dynpro Locate the document in its SAP Library structure

Use

As with the EJBs, you have to create a permission class that is used to check the permissions in the Web Dynpro. In this case, you will create a permission class that extends the pre-defined NamePermissionclass. For more information about permission classes, see Permission Class for Your Application.

Prerequisites

This graphic is explained in the accompanying textThis graphic is explained in the accompanying text

The Web Dynpro perspective is displayed in the SAP NetWeaver Developer Studio.

This graphic is explained in the accompanying textThis graphic is explained in the accompanying text

The Web Dynpro car rental project is displayed in the Navigator.

Procedure

...

       1.      Switch to the Navigator.

       2.      Select the TutWD_CarRental project, open the context menu and choose New  ® Other…

       3.      In the left pane of the dialog that follows, select Java; in the right pane, select Class and choose Next.

The New Java Class dialog appears.

       4.      Enter the package and a name for the permission in the corresponding fields. Use com.sap.tut.wd.carrental as the Package: and WDCarRentalPermission for the Name.

       5.      Enter com.sap.security.api.permissions.NamePermission in the Superclass: field.

       6.      For the method stubs, select Constructors from superclass and Inherited abstract methods.

       7.      Choose Finish to continue.

The Developer Studio creates the WDCarRentalPermission, which extends the NamePermission class.

       8.      Change the arguments for the WDCarRentalPermission. Change arg0 to name and arg1 to action.

       9.      Delete the // TODO Auto-generated constructor stub line.

   10.      Save the file.

Result

The Java class WDCarRentalPermission is created. See the code sample below.

package com.sap.tut.wd.carrental;

import com.sap.security.api.permissions.NamePermission;

public class WDCarRentalPermission extends NamePermission {

   /**
    *
@param name
    */
   public WDCarRentalPermission(String name) {
     
super(name);
   }

   /**
    * @param name
    * @param action
    */
   public WebDynproCarRentalPermission(String name, String action) {
     
super(name, action);
   }
}

Next Step:

Checking the Permission in the Web Dynpro Client

 

End of Content Area