Jifty::Plugin::Quota.3pm

Langue: en

Autres versions - même langue

Version: 2007-12-26 (ubuntu - 07/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

Jifty::Plugin::Quota - Provides a framework for generic quota management of Jifty model objects

SYNOPSIS

In your config.yml:
   Plugins:
     - Quota:
         disk:
           User: 5242880   # bytes (5MB)
           Group: 10485760
 
 

By inserting hooks and checks into an app (actions and models, most likely), quotas can be updated and enforced. It is up to the developer to do this though; this plugin just provides a ready-made framework.

The configuration provides defaults for quota creation. It is structured by type and then object_class. In the example above, the default disk space quotas for User and Group model objects are set. When a new quota is created and a cap is not specified, the plugin will look up the default in the config.

METHODS

config

init

default_cap TYPE CLASS

Returns the default cap (if there is one) as specified by the config for the given TYPE and CLASS. Returns undef otherwise.