Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Does a user belong to this group?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00539959
Message ID:
00539991
Vues:
20
Hi again,

I managed to do this, but in case someone comes up with the same question in the future, here's an overview of what I did:

- Created a usergroups_bo bizobj using usergroupsenvironment as data environment.
- In its post-requery hook I scan through the cursor and build a string with all the groups this user belongs to (i.e. "*$* supervisors *$* managers *$* power users *$*".
- In aUserMgr's registeruser method I added a dodefault() and then I instantiate usergroups_bo into a local variable and issue a requery.
- I then copy usergroups_bo.cGroupsList (the string) into a local property with the same name.
- Then I have a new method in aUserMgr called IsCurrentUserInGroup() as follows:
lparameter tcGroupName
tcGroupName = "*$* " + alltrim( lower( tcGroupName)) + " *$*"
return tcGroupName $ This.cGroupsList
If anyone has better ideas, let's hear them!

Alex


>Hi,
>
>How can I determine quickly if a user belongs to a particular group?
>
>In an app I'm working on, I need to set certain rules at the interface level, however, I need users who belong to the "supervisors" (or any group I specify by name) to be able to bypass those rules.
>
>So, is there something like ThisUserBelongsToGroup("supervisors") available in MM 6.1?
>
>If not, I'd appreciate some ideas as to how and where to implement a method like this.
>
>Thanks!!!!
>
>Alex
Low-carb diet not working? Try the Low-food diet instead!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform