Schultz’s PowerBuilder Notes

PFC Security Q and A

How do I enable the PFC security service?

A common place to do this the pfc_postopen event of w_frame

gnv_app.of_SetSecurity(True) //Enable security service

How do I force security to run on a particular object

Argument can be Window, GraphicObject, or DataWindow variable containing the window, DataWindow, or window control for which security is applied.

lb_rc = gnv_app.inv_security.of_SetSecurity(lw_frame)

How do I initialize the security service?

When initializing the security service, the last argument is used if the user was not assigned to any other group.

inv_security.of_InitSecurity(SQLCA, ClassName(iapp_object), of_GetUserID(), “Default”) //Initialize the security service

How do I enable security on each applicable window?

In the window open or pfc_preopen event


Handy SQL building SQL

Let’s say you want to add a new security group called “al$lm0001_acct”. The following SQL will create a duplicate set of security entries based on a current group called “al$lm0001_fintm” for the security_info table on the database QUAD0009.

Select 'Insert into QUAD0009.dbo.security_info(application, window, control, user_name, status)
values ("lm0001", "' + window + '", ''' + control + ''', "al$lm0001_acct", ''' + status + ''') '
from QUAD0009.dbo.security_info
Where user_name = "al$lm0001_fintm"

Now you just need to update the status values you want for your new security group and voila!

How do I add Security to a Datawindow Column?

Window: <window name>

control: <datawindow control>.<column name>


July 21, 2008 - Posted by | 3. PFC, Utility Services | , , , ,

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: