Security by User defined Function

To apply security in a user defined function

  • Go to the program> tab events and Open the .p file mentioned in the events.
  • Define the function as required.
  • A user defined function should be written in xxxxpcustom.p
  • The figure below is an example of the code in .p file that allows for the passed parameter ”guest” to return value 0 otherwise 1.
    User defined function in x/xxxxpcustom.p

  • Now in the Right panel > tab Program > section Security properties, type the predefined function as shown in the figure below:
    User defined function in security

  • To test if the function is compatible or not, we invoked the function with parameter “guest” which returns 0 and expression evaluates to false so the button will be disabled. For parameter other than “guest” the create button will be enabled.
    Security applied via user defined function

  • User-defined functions reside in the program level only.
  • All the functions in the program run persistently in a session.
  • Functions can also be placed in rule also for the same functionality.

results matching ""

    No results matching ""