PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • 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
WINDEVWEBDEV - Server codeReports and QueriesWindows MobileAjaxUser code (UMC) 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 a user to another one
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