Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting Object Level Security
Message
De
21/02/2007 16:47:52
 
 
À
21/02/2007 15:58:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01197756
Message ID:
01197784
Vues:
15
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform