Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Settings ACLs

A component or application that owns public settings includes information in its CIF specifying the subtree of the registry that it owns, which can include ACLs to control access to the settings. ACLs specify the following:

  • One or more groups, each specified by a hexadecimal number (0 indicates everyone). Multiple groups can be specified using a comma-separated list of hexadecimal numbers.
  • A string specifying access privileges for each group.

    The string specifies two privileges separated by "/"; the first is for the subtree, the second is for any children of the subtree.

  • A string specifying the path to the registry subtree to which the privileges apply.

The following example shows a CIF entry that registers an .ini file settings store and includes ACLs giving everyone read permission and giving write permission to one group.

local s = require 'SettingsCIFHelpers'

-- register my settings at "/myApp/myIniSettings/..."
s:RegisterIniFile {
   owner = 0x12345678,
   key = "/myApp/myIniSettings",
   file = "mysettings.ini",
   acls = {
      { -- grant everyone read access to my settings but write access
        -- to only those modules belonging to the 0x1234fedc group
         {
            groups = {0}, 
            perms = "r/r",
         },
         {
            groups = {0x1234fedc}, 
            perms = "rw/rw",
         },
         path = "/myApp/myIniSettings"
      },
   }
}