Permissions Schema: Forums Table

From XMBdocs

Each forum is created by a board Administrator or Super Administrator using the cp.php script, which sets values in five permissions columns. After a board is created, these values can be modified by the administrative staff using the same script.

Status

forums.status is a VARCHAR(15) column always set by the creator at creation. All possible values for this column are listed below:

 *'off'
 *'on'

When the value is 'off' then XMB must not display this forum or any related records to any user, except within the cp.php script itself. This setting effectively disables the forum and all of its contents.

This setting is not inheritable, that is, sub forums of a disabled forum are still accessible even if they are not displayed on the front page.

Moderator

forums.moderator is a VARCHAR(100) column always set to '' (empty string) at creation. The set of possible values for this column are described as follows:

  • '' (empty string)
  • Any Comma-Delimited MySQL String Having 1 <= Chars <= 100

The format of the moderator value is implode(',', $username_array) and it is assumed the username values are retrieved using trim() so that whitespace is allowed adjacent to commas, and they are case-insensitive due to lack of explicit collation in the XMB database schema.

When a user with the rank of Moderator is authorized, their permissions are evaluated in one of two ways:

  1. X_STAFF - Any user with the rank of Moderator is considered a staff member regardless of context, and will be given full staff permissions.
  2. modcheck() - Any user with the rank of Moderator must have their username in the value of the moderators column for the current forum before receiving any moderation permissions.

All Super Moderators are implicitly included in the moderator list. Therefore, users ranked Super Moderator and above are never affected by this setting.

This setting is not inheritable, that is, sub forums of a moderated forum may not be moderated by a user with the rank of Moderator unless that user's username is in the moderator column value of the sub forum.

Password

forums.password is a VARCHAR(32) column always set to '' (empty string) at creation. The set of possible values for this column are described as follows:

  • '' (empty string)
  • Any MySQL String Having 1 <= Chars <= 32

When the value is not '' then the user must supply the password (authenticate) for this forum before receiving any permissions, regardless of rank. Any user who does not authenticate is effectively banned from that forum.

This setting is inheritable, that is, sub forums of a password-protected forum are not accessible unless the user has authenticated to the parent. If the sub forum also has a password, then the user must authenticate to both of the forums before receiving any sub forum permissions.

Userlist

forums.userlist is a TEXT column always set to '' (empty string) at creation. The set of possible values for this column are described as follows:

  • '' (empty string)
  • Any Comma-Delimited ~MySQL String

The format of the userlist value is implode(',', $username_array) and it is assumed the username values are retrieved using trim() so that whitespace is allowed adjacent to commas, and they are case-insensitive due to lack of explicit collation in the XMB database schema.

When the value is not '' then the user must be one of the users with their username in the list before receiving any permissions. All forum moderators are implicitly included in the userlist by way of modcheck(). Therefore, users ranked Super Moderator and above are never affected by this setting.

This setting is inheritable, that is, sub forums of a userlist-protected forum are not accessible unless the user is authorized by the parent. If the sub forum also has a userlist, then the user must be authorized by both of the forums before receiving any sub forum permissions.

Postperm

forums.postperm is a VARCHAR(11) column always set to '31,31,31,63' at creation. The set of possible values for this column are described as follows:

  • A String of 4 Comma-Delimited Integers Having at least strlen('0,0,0,0') but not more than 11 Chars

These 4 integer values are not formally enumerated in the code base, however they do have assigned meaning that changed as of version 1.9.9. This will become more formal in version 1.9.11 to accommodate future uses and flexibility. See the Best Practices section below to learn how to make your code compatible with current and future versions.

The indexes of the 4 delimited positions are formally enumerated as of version 1.9.9 under the comment // permissions constants in header.php. The indexes are read from left-to-right beginning with zero, corresponding to the array output of explode().

This setting is sometimes inheritable, that is, sub forums of an access-restricted forum are not accessible unless the user is authorized by the parent. However, the permissions other than VIEW are typically not inherited.