Syntax
long db.permission( long table_id [, string field(18) [, ref string buffer(.)]] )
Description
Use this to check the access permissions that a user has to a specified table or table field.
Arguments
table_id The table ID, as returned by db.bind().
field To check the permissions for a particular field, enter the field name here. If you do not specify a field here, or if you specify an empty string, the function returns the permissions for the table.
buffer A user's permissions for a table or table field can depend on the contents of a record. In this case, you must specify the record buffer of the table in the buffer argument. The function returns the user's permissions for the record in the record buffer. If a user's permissions depend on the contents of a record, and you do not specify the buffer argument, the function returns PERM.UNKNOWN.
Return values
The function returns a long that indicates the permissions that the user has on the table or on a specified field of that table. The return value consists of one of, or a combination of, the following codes:
NO.PERMISSION 1
PERM.READ 2
PERM.MODIFY 4
PERM.WRITE 8
PERM.DELETE 16
NO.RESTRICTION (PERM.READ+PERM.MODIFY+PERM.WRITE+PERM.DELETE)
PERM.UNKNOWN 32
So, if the value 6 is returned, the user is permitted to both read and modify the specified table or table field.
Related Post:
long db.permission( long table_id [, string field(18) [, ref string buffer(.)]] )
Description
Use this to check the access permissions that a user has to a specified table or table field.
Arguments
table_id The table ID, as returned by db.bind().
field To check the permissions for a particular field, enter the field name here. If you do not specify a field here, or if you specify an empty string, the function returns the permissions for the table.
buffer A user's permissions for a table or table field can depend on the contents of a record. In this case, you must specify the record buffer of the table in the buffer argument. The function returns the user's permissions for the record in the record buffer. If a user's permissions depend on the contents of a record, and you do not specify the buffer argument, the function returns PERM.UNKNOWN.
Return values
The function returns a long that indicates the permissions that the user has on the table or on a specified field of that table. The return value consists of one of, or a combination of, the following codes:
NO.PERMISSION 1
PERM.READ 2
PERM.MODIFY 4
PERM.WRITE 8
PERM.DELETE 16
NO.RESTRICTION (PERM.READ+PERM.MODIFY+PERM.WRITE+PERM.DELETE)
PERM.UNKNOWN 32
So, if the value 6 is returned, the user is permitted to both read and modify the specified table or table field.
Related Post:
0 comments:
Post a Comment