Xbasic

A5_SecGroupHasPermission Function

Syntax

Result_Flag as L = A5_SecGroupHasPermission(C GroupName ,C name ,C class ,C permission )

Arguments

GroupNameCharacter

The name of a group.

nameCharacter

The name of the object and the data dictionary that contains it.

classCharacter

The type of object for which you are changing permissions. Valid values are listed below in the format "Object Class" (Filename Extension of Data Dictionary used in Name parameter):

  • "Table" (table name)
  • "Form" (.DDD or .SET)
  • "Browse" (.DDD or .SET)
  • "Report" (.DDD or .SET)
  • "Letter" (.DDD or .SET)
  • "Label" (.DDD or .SET)
  • "Function" (.ALB)
  • "Script" (.ALB)
  • "Menu" (.ALB)
  • "Toolbar" (.ALB)
  • "Append records" (.DDD or .SET)
  • "Convert case of fields" (.DDD or .SET)
  • "Crosstab" (.DDD or .SET)
  • "Delete/Mark/Unmark records" (.DDD or .SET)
  • "Export records" (.DDD or .SET)
  • "Import records" (.ALB)
  • "Intersect/Join/Subtract records" (.DDD or .SET)
  • "Post records" (.DDD or .SET)
  • "Query records" (.DDD or .SET)
  • "Search and replace" (.DDD or .SET)
  • "Update records" (.DDD or .SET)
permissionCharacter

The permission that is being changed. Valid values for object types are listed below:

  • Sets
    • "Default browse"
    • "Default form"
    • "Delete"
    • "Design"
    • "Drop"
  • Tables
    • "Change records"
    • "Default browse"
    • "Default form"
    • "Delete records"
    • "Enter records"
    • "View records"
  • All Other Objects
    • "Delete"
    • "Design"
    • "Delete"
    • "Design"
    • "Run"

Returns

Result_FlagLogical

Returns .T. if the group has access to the object. Otherwise, returns .F. if the group does not have access to the object.

Description

The A5_SecGroupHasPermission() indicates whether a named group has permission to an object.

Discussion

The A5_SecGroupHasPermission() function checks to see if a group has permission to access an object, such as a table or form.

Example

? A5_SecGroupHasPermission("Writers", "myform", "form", "run")
= .T.
For objects based on tables with security permissions, the group must have permissions to View Records at a minimum. Otherwise, A5_SecGroupHasPermission() will return .F. because the group does not permissions to access the table.

Limitations

Desktop applications only.

See Also