!--a11y-->
Creating the Permission Class for the Web
Dynpro 
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.
|
|
The Web Dynpro perspective is displayed in the SAP NetWeaver Developer Studio. |
|
|
The Web Dynpro car rental project is displayed in the Navigator. |
...
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.
The Java class WDCarRentalPermission is created. See the code sample below.
package
com.sap.tut.wd.carrental; |
Checking the Permission in the Web Dynpro Client