Link to home
Start Free TrialLog in
Avatar of Coral_F
Coral_F

asked on

LotusScript code to test presence of a person in a group

Hi
I have been asked to perform a task  to test if the user logged in is a member of a certain group to edit data in one form and was told it could be done in Lotusscript. Could anyone give me a idea about how to start with this, it would be much apprecated. Thanks :)
Avatar of CRAK
CRAK
Flag of Netherlands image

You could start in the group document and recursively look into it's content (in each group you could find people and groups).
Easier, but kind of "dirty" is to use evaluate on @UserNamesList.
It's not dirty but a great way to get this info.  

dim v as Variant
const certainGroup = "certainGroup"

v = Evaluate({@IsMember("} & certainGroup & {";@UserNamesList)}
If Isnumeric(v) Then
    If v = 1 Then Print "User is a member of the required group"
End  If
Avatar of Coral_F
Coral_F

ASKER

Thanks for your comments :) This is going to be used to lock down the form so only "certainGroup" can edit it. I can see that the first bit of code is to test to see if the user is in the group but how would you code the bit for if the user isnt in the group. would a prompt work? and where would this piece of code be best put? Postopen?
Thanks again for your help.
ASKER CERTIFIED SOLUTION
Avatar of CRAK
CRAK
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Coral_F

ASKER

Thank you:)