ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL Client/Server functions
  • Retrieving the rights granted to the users and copying these rights
HInfoDatabaseRights (Example)
Retrieving the rights granted to the users and copying these rights
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 rights to read and add granted to
// the user named Smith on MyDatabase
sRights = HInfoDatabaseRights("CNT", "Smith" , ...
hRightsRead+hRightsInsert, "MyDatabase")
sARight = ExtractString(sRights, firstRank, TAB)
WHILE sARight<>EOT
SWITCH sARight
      CASE hAllowed
// Process
      CASE hForbidden
// Process
      CASE hInherit
// Process
    END
    sARight = ExtractString(sRights, nextRank, TAB)
END
 
// Retrieves the actual rights to read and add granted to
// the user named Smith on MyDatabase
sRights = HInfoDatabaseRights("CNT", "Smith" , ...
hRightsRead+hRightsInsert, "MyDatabase", True)
sARight = ExtractString(sRights, firstRank, TAB)
WHILE sARight<>EOT
    SWITCH sARight
      CASE hAllowed
  // Process
      CASE hForbidden
  // Process
END
    sARight = ExtractString(sRights, nextRank, TAB)
END
 
// Copy the rights from a user to another one
sRights1 is string
sRights1 = HInfoDatabaseRights("CNT", "Smith", ...
  hRightsRead + hRightsInsert, "MyDatabase")
HModifyDatabaseRights(CNT, "Clark",...
hRightsRead + hRightsInsert, sRights1, "MyDatabase")
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help