|
|
|
|
|
HInfoDatabaseRights (Function) In french: HInfoDroitBaseDeDonnées
Available only with this kind of connection
Gets the rights granted to a user or group on a database.
LesDroits is string
UnDroit is string
LesDroits = HInfoDatabaseRights("CNX", "Dupont", hRightsRead + hRightsInsert, "MaBase")
UnDroit = ExtractString(LesDroits, firstRank, TAB)
WHILE UnDroit <> EOT
SWITCH UnDroit
CASE hAllowed
...
CASE hForbidden
...
CASE hInherit
...
END
UnDroit = ExtractString(LesDroits, nextRank, TAB)
END
Syntax
<Result> = HInfoDatabaseRights(<Connection> , <User/Group> , <Rights> , <Database> [, <Display mode>])
<Result>: Character string - Requested information,
- Empty string ("") if an error occurred.
- "Unknown user" or "Unknown group" if the current user has no permissions to see other users (hRightsSeeUser constant) and wants to get information about another user or group.
The requested information depend according to the parameter <Display mode of result>: - In hDefault mode, <Result> is a list of values separated by tabs.
<Value of rights 1> + TAB + ... + TAB + <Value of rights N> where <Value of rights> corresponds to the value of the rights requested by the <Rights> parameter. The values in the list can correspond to one of the following constants:
| | hAllowed | The relevant rights are granted to the user or group. | hForbidden | The relevant rights are not granted to the user or group. | hInherit | The right is undefined at this level for the user (or the group to which they belong). The HFSQL server uses the right defined at the top level for the user (or the group to which the user belongs). For the database, the HFSQL server uses the right defined for the user (or the group to which the user belongs) at server level. This constant is returned only if the display mode is not set to hEffective. |
- In hDetails mode, <Result> is a list of values with the following format:
<Relevant rights 1> + TAB + <Value of rights 1> + CR + ... <Relevant rights N> + TAB + <Value of rights N> + CR where: - <Relevant rights> corresponds to one of the constants used in the <Rights> parameter.
- <Value of rights> corresponds to one of the constants:
| | hAllowed | The relevant rights are granted to the user or group. | hForbidden | The relevant rights are not granted to the user or group. | hInherit | The rights are undefined at this level. The HFSQL server uses the rights defined at the higher level:- rights defined at group level for a user.
- right defined at server level for a database.
This constant is returned only if the display mode is not set to hEffective. |
<Connection>: Character string or Connection variable Connection for which the rights of a user or group of users must be known. This connection corresponds to: <User/Group>: Character string Name of the user or group whose rights you want to get. <Rights>: Integer constant (or combination of constants) List of rights to find: | | hRightsAll | List of all the rights We recommend that you use this constant in hDetails or hEffective + hDetails display mode. | hRightsAutoModif | Rights to perform an automatic modification on a data file. | hRightsBackup | Rights to perform a backup. | hRightsChangeLink | Rights to change the integrity rules of a data file. | hRightsChangeOwner | Rights to change the owner of an element. | hRightsChangeRights | Rights to change rights. | hRightsConnection | Rights to connect to a server (encrypted or unencrypted connection). | hRightsCreateFile | Rights to create a data file (with HCreation). | hRightsCreateView | Rights to create a view. | hRightsDebug | Rights to debug stored procedures. | hRightsDelete | Rights to delete the records from a data file. | hRightsDeleteDB | Rights to delete a database. | hRightsDeleteFile | Rights to delete a data file (HDeleteFile). | hRightsDeleteView | Rights to delete a view. | hRightsEncryptedConnection | Rights to connect to a server (encrypted connection only). | hRightsInsert | Rights to add records to a data file. | hRightsLock | Rights to lock the data files or the records of a data file. | hRightsMaintenance | Rights to start a re-index operation or to perform statistical calculations on a data file. | hRightsManageDuplicate | Rights to enable and disable the management of duplicates. | hRightsManageIntegrity | Rights to enable and disable the management of integrity. | hRightsManageProcedure | Rights to add, modify and delete the sets of procedures. | hRightsManageTrigger | Rights to add, enable and delete server triggers. | hRightsNoDatabaseAccess | Rights to prevent access to a database (HNoDatabaseAccess and HEndNoDatabaseAccess). | hRightsRead | Rights to read the records of a data file. | hRightsRunProcedure | Rights to run a stored procedure. | hRightsUnmask | Rights to unmask items in the database files. | hRightsUpdate | Rights to modify the records of a data file. |
<Database>: Character string Name of the database for which to get the rights. <Display mode>: Optional Integer constant Result display mode:
| | hDefault (Default value) | The rights returned do not take the inherited rights into account (rights granted to the groups to which the user belongs). If no rights were defined, the value will be set to hInherit. <Result> contains the values of the requested rights (in the same order). | hDetails | Same as hDefault. <Result> contains the rights and there value. | hEffective | The rights returned correspond to the rights that will be actually granted to the user or to the group on the database. Inherited rights are taken into account (for example, rights granted to the groups to which the user belongs). | hEffective + hDetails | Same as hEffective. <Result> contains the rights and there value. |
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|