KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Retrieving the group IDs of the groups to which the current user belongs
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: November 1, 2002
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

Compatibility: Version 6.7 and 6.8

Here is a simple project method that will return the group IDs of groups to which the current user belongs:

  ` Project Method: GetCurrentUserGroups
` Description: return group IDs of groups that contain the current user
  `
` $1 - Pointer to an array

C_POINTER($1)
C_LONGINT($found)
C_TEXT(name;startup;password)
C_BOOLEAN(nbLogin)
C_DATE(lastLogin)
ARRAY TEXT(userNames;0)
ARRAY LONGINT(userNumbers;0)
GET USER LIST(userNames;userNumbers)
$found:=Find in array(userNames;Current user)
GET USER PROPERTIES(userNumbers{$found};name;startup;password;nbLogin;lastLogin;$1->)