»5. Setting Capabilities

Capabilities are used to define limits that are imposed on user accounts. For more information, please read Chapter 21: Capabilities Classes.

Note

Consult Section 3: Capabilities Reference for reference when defining capabilities.

No matter what your setup is, %LJ::CAP_DEF should always be defined, set with sane limits per capability.

Example 9.2. Sample %LJ::CAP_DEF

%CAP_DEF = (
        'maxfriends' => 5,
        'userpics' => 1,
        'checkfriends_interval' => 60,
        'checkfriends' => 1,
        'styles' => 0,
        'todomax' => 25,
        'todosec' => 0,
        'friendsviewupdate' => 30,
        'findsim' => 1,
);
      

Classes.  Classes are defined as hashes under the single hash %LJ::CAP. The keys of %LJ::CAP are the 16 different bits (0-15). The keys of those hashrefs are the capability names, and the values are the capability settings.

Example 9.3. Sample %LJ::CAP

%CAP = (
    '0' => {  # 0x01
        '_name' => 'new user',
        'userpics' => 1,
    },
    '1' => {  # 0x02
        '_name' => 'free user',
        'userpics' => 3,
    },
    '2' => {  # 0x04
        '_name' => 'paid user',
        'styles' => 1,
        'makepoll' => 1,
        'userpics' => 10,
        'paid' => 1,
        'useremail' => 1,
        'textmessaging' => 1,
    },
    '3' => {  # 0x08
        '_name' => 'permanent account',
        'paid' => 1,
        'useremail' => 1,
    },
);