>I am looking for some guidance regarding sophisticated access to controls on a form. Our application must be able to determine if a user will have access to a menu item or form control(s) based on group permissions, individual permissions, etc. I know MM has several security objects, does anyone have any experience with this type of implementation? Do you use a third-party product or have you implemented your own solution? A data-driven solution that would require manually updating seems cumbersome.
>TIA
>Amanda
Here something to start with. This returns a list of the NT security group the current user has access. In the INIT of base classes, test the security group against what is allowed for the control, and either set the enabled to False or the Visible property to False.
PROCEDURE LocalGroups
LOCAL strComputer, objWMIService, colItems, objItem, lcResult
lcResult = ""
#IF VERSION(5)>600
strComputer = "."
objWMIService = GETOBJECT( "winmgmts:\\" + strComputer + "\root\cimv2")
colItems = objWMIService.ExecQuery("Select * from Win32_Group Where LocalAccount = True")
lcResult = crlf
IF NOT TYPE("colItems.Count")=="O"
FOR EACH objItem IN colItems
lcResult = lcResult + TRANSFORM(objItem.NAME) + crlf
NEXT
ENDIF
#ENDIF
RETURN lcResult
ENDPROC
Greg Reichert