ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL Client/Server functions
  • Retrieving the rights granted to users on a data file and copying these rights
HInfoFileRights (Example)
Retrieving the rights granted to users on a data file and copying these rights
WEBDEV - Server codeAjax The following example is used to:
  • find out the default rights granted to a user
  • find out the rights actually granted to a user
  • copy the default rights granted to a user to another user
sRights is string
sARight is string
// Retrieves the read/add rights granted to the user named Moore 
// on the MyFile.fic file found in MyDatabase
sRights = HInfoFileRights("CNT", "Smith" , ...
	hRightsRead + hRightsInsert, "MyDatabase", "MyFile.fic")
sARight = ExtractString(sRights, firstRank, TAB)
WHILE sARight <> EOT
	SWITCH sARight
      		CASE hAllowed
      		...
      		CASE hForbidden
      		...
      		CASE hInherit
      		... 
    	END
   	sARight = ExtractString(sRights, nextRank, TAB)
END 

// Get the read and add rights for the user named Smith
// on the MyFile.fic file found in MyDatabase
sRights = HInfoFileRights("CNT", "Smith", ...
	    hRightsRead + hRightsInsert, "MyDatabase", "MyFile.fic", True)
sARight = ExtractString(sRights, firstRank, TAB)
WHILE sARight <> EOT
	SWITCH sARight
		CASE hAllowed
      		...
      		CASE hForbidden
      		... 
    	END
	sARight = ExtractString(sRights, nextRank, TAB)
END

// Copy the rights from one user to another
sRights1 is string
sRights1 = HInfoFileRights("CNT", "Smith" , ...
	hRightsRead + hRightsInsert, "MyDatabase", "MyFile.fic")
HModifyFileRights("CNT", "Doe", hRightsRead+hRightsInsert, ...
	sRights1, "MyDatabase", "MyFile.FIC")
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 11/22/2024

Send a report | Local help