Ini tree auth

From EventScripts Community Encyclopedia

ini_tree_auth is an AuthorizationService provider that ships with EventScripts. It reads a file in the server's ./cfg/ directory called ini_tree_auth.ini which is an ini-like file that holds the Steam IDs and capabilities of each user with authorization. It can also import Mani's clients.txt into the ini tree if desired.

Overview

ini_tree_auth is somewhat similar to group_auth except users and capabilities are store in a human-readable and -editable form. Similar to mani_basic_auth it can also import Mani's clients.txt. ini_tree_auth imports the flags designated to users in your ./cfg/mani_admin_plugin/clients.txt and registers those flags as permissions with the prefix "mani_flag_" -- such that the a flag translates to the permission mani_flag_a, the pban flag translates to the permission mani_flag_pban, etc. Addon authors can check the flag permissions in their addons if they want to support Mani flags. Any player with the mani_flag_admin permission is considered an admin to ini_tree_auth, all other users are considered power users.

Usage

To load ini_tree_auth put the following at the beginning of your autoexec.cfg:

es_load examples/auth/ini_tree_auth
When you first load ini_tree_auth the file ./cfg/ini_tree_auth.ini will be created on your server. The default setting includes only STEAM_ID_LAN which is designated as an admin. When first created ini_tree_auth.ini will look similar to:
# ./cfg/ini_tree_auth.ini
# Use the space below to add players to ini_tree_auth
# For more information see: http://www.eventscripts.com/pages/ini_tree_auth

# This group is usually reserved for server owners as players at level will be authorized for everything.
[ROOT]

# This group is for players who should be allowed to use admin commands (kick, ban, etc.)
[ADMIN]
    [[STEAM_ID_LAN]]

# This group is for players who should receive some special privileges (clan members, etc.)
[POWERUSER]

# This group is for players who are authorized only for specific capabilities
[NOGROUP]
The format for adding new users to a group is:
[GROUP NAME]
    [[STEAM ID]]
        auth_capability = True # Explicitly allow this capability
        other_capability = False # Explicitly disallow this capability (regardless of group)
Here is an example of how the contents of ini_tree_auth.ini might look:
# ./cfg/ini_tree_auth.ini
# Use the space below to add players to ini_tree_auth
# For more information see: http://www.eventscripts.com/pages/ini_tree_auth

# This group is usually reserved for server owners as players at level will be authorized for everything.
[ROOT]
    [[STEAM_0:0:0000001]] # Mattie
        eat_puppies = False # Only Venjax gets this capability (as ROOT)
        visit_grandchildren = False # Even Mattie and Venjax don't have this capability
    [[STEAM_0:0:0000002]] # Venjax
        visit_grandchildren = False

# This group is for players who should be allowed to use admin commands (kick, ban, etc.)
[ADMIN]
    [[STEAM_0:0:0000003]] # Don
        visit_grandchildren = True
    [[STEAM_0:0:0000004]] # Errant
    [[STEAM_0:0:0000005]] # SuperDave

# This group is for players who should receive some special privileges (clan members, etc.)
[POWERUSER]
    [[STEAM_0:0:0000006]] # Bonbon
         buy_beer = False
    [[STEAM_0:0:0000007]] # Saul

# This group is for players who are authorized only for specific capabilities
[NOGROUP]

To import Mani's clients.txt into ini_tree_auth you must use the following command on the server console: initreeauth_importmani. You do not need to restart your server for the changes to take effect, but importing clients.txt will only add to the ini tree -- it won't remove duplicate Steam IDs that exist in other groups nor will it remove any capabilities. It is recommended you address those issues before importing Mani's clients.txt.

See Also

  • Authorization FAQ -- A FAQ about ES authorization providers.
  • basic_auth -- A simple authorization provider.
  • mani_basic_auth -- A simple authorization provider that imports admins and capabilities from Mani's clients.txt.
  • group_auth -- An advanced authorization provider with user- and group-based access to unique addon permissions.
blog comments powered by Disqus