"""Rule folder implementation

$Id: $
"""

__authors__ = 'Geoff Davis <geoff@geoffdavis.net>'
__docformat__ = 'restructuredtext'

from AccessControl import ClassSecurityInfo
from Products.Archetypes import public as atapi
from Products.CacheSetup.content.interfaces import ICacheToolFolder
try:
    from Products.CMFCore import permissions
except ImportError:
    from Products.CMFCore import CMFCorePermissions as permissions

class RuleFolder(atapi.OrderedBaseFolder):
    """A container for rule objects"""

    __implements__ = (atapi.OrderedBaseFolder.__implements__, ICacheToolFolder)
    
    security = ClassSecurityInfo()
    archetype_name = 'Rule Folder'
    portal_type = meta_type = 'RuleFolder'
    global_allow = 0
    allowed_content_types = ('ContentCacheRule','TemplateCacheRule','PolicyHTTPCacheManagerCacheRule')

    actions = (
        {'action':      'string:$object_url/cache_setup_config',
         'category':    'object',
         'id':          'view',
         'name':        'Cache Setup',
         'permissions': (permissions.ManagePortal,),
         'visible':     False},
    )

    aliases = {
        '(Default)':    'cache_setup_config',
        'view' :        'cache_setup_config',
        'edit' :        'base_edit'
    }

atapi.registerType(RuleFolder)
