Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

File Permissions

When FairCom DB creates a file, the User ID of the creating user is assigned to the file as the file’s owner. The owner’s default group is also assigned to the file unless the creating function specifies one of the owner’s other Group ID’s.

Further, the user may specify a permission mask that determines the kind of access that users may acquire on subsequent opens. The mask is comprised of three components: owner permissions, group permissions and world permissions. With this structure, you are able to allow different users different levels of access to the file.

When the owner of a file opens that file, that user is given owner’s permissions. Typically this level allows the user the most flexibility in managing the file. If a user who is not an owner of the file opens that file, FairCom DB looks at the groups the user belongs to. If that user is a member of the group assigned to the file then the user is granted group permissions. Finally, a user not falling into these categories is granted world permissions. Generally, permissions become more restrictive as you go from owner to world.

For example, an owner of a file may be able to read, write, and update records, and delete the file if necessary. Another user who is a member of the group for that file could have permission to read, write, and update records, but not to delete the file. Finally, a user who is not an owner, and not a member of the file’s group, may have permission only to read the file.

Permission Mask

When the file is created you will provide a permission mask for that file. The permission mask is formed by OR-ing the appropriate permission constants (found in ctport.h) from the following list:

Permission Constant



owner read permission


owner write/update permission


owner file definition permission


owner file deletion permission


owner granted all permissions


owner grants read only without password


group access denied


group read permission


group write/update permission


group file definition permission


group file deletion permission


group read only access without password


world access denied


world read permission


world write/update permission


world file definition permission


world file deletion permission


world read only access without password

  • “READ” permission grants access to data, but no ability to change the data.
  • “WRITE” permission grants update abilities.
  • “DEF” permission allows the user to change or set file definition characteristics such as alternative collating sequences and record schemas.
  • “DELETE” permission grants the ability to delete the entire file.

For example, to grant the owner all permissions, to grant group members read and update permissions, and to permit no access outside of the group, the permission mask should be defined as:


If no permission mask is assigned to the file, owner, group and world are granted all permissions. Permission masks, file ownership and group assignment may also be changed by using the Security() function, or by the system administrator.