AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Administrar bases de datos / HFSQL / Funciones HFSQL Client/Server
  • 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 - Código ServidorReportes y ConsultasCódigo de Usuario (UMC)Ajax 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")
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 22/11/2024

Señalar un error o enviar una sugerencia | Ayuda local