Skip to content

Instantly share code, notes, and snippets.

@viniciusgati
Created June 9, 2014 00:43
Show Gist options
  • Save viniciusgati/e5177a2ed634d7582b95 to your computer and use it in GitHub Desktop.
Save viniciusgati/e5177a2ed634d7582b95 to your computer and use it in GitHub Desktop.
#include "protheus.ch"
Class Mil_AccessControl
Method New() Constructor
Method ExclusiveAccess()
Method LoggedInUsers()
EndClass
Method New() Class Mil_AccessControl
Return Self
Method ExclusiveAccess() Class Mil_AccessControl
Return Len( self:LoggedInUsers() ) == 1
Method LoggedInUsers() Class Mil_AccessControl
Local aLgUsers := GetUserInfoArray()
Local nIdx := 1
Local aUsers := {}
For nIdx := 1 to Len(aLgUsers)
AADD( aUsers, aLgUsers[nIdx][1] )
Next
Return aUsers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment