Developing the Authorization Application Class
The application class for the authorization service must be created from the base interface PTCS_SECURITY:Security:SecurityHandler. This base interface has only one method, GetAuthorization, which must be implemented by all child classes. This method receives an array of AuthRequest objects as parameters.
Note:
You need to develop the security authorization application class when you are performing row-level authorization.
Import PTCS_SECURITY:Security:*;
Class SampleSecurityAppclass extends PTCS_SECURITY:Security:SecurityHandler
/*method AuthRequestHandler(&arrAuthReq As array of PTCS_SECURITY:Security:*/
/*AuthRequest);*/
method GetAuthorization(&arrAuthReq As array of PTCS_SECURITY:Security:AuthRequest);
end-class;
/*method AuthRequestHandler*/
method GetAuthorization
/+ &arrAuthReq as Array of PTCS_SECURITY:Security:AuthRequest +/
/+ Extends/implements PTCS_SECURITY:Security:SecurityHandler.GetAuthorization +/
Local integer &i;
Local string &val, &userid;
/* Setting the Access Property in the AuthRequest object */
For &i = 1 To &arrAuthReq.Len
&arrAuthReq [&i].Access = "T";
End-For;
/* Reading the Keyvalue from the AuthRequest object */
&val = &arrAuthReq [1].GetParameterValue("CUSTOMER");
/* Reading the userid from the AuthRequest object */
end-method;