/usr/share/pyshared/zope/security/metadirectives.py is in python-zope.security 3.8.3-2ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Component architecture related 'zope' ZCML namespace directive interfaces
"""
__docformat__ = 'restructuredtext'
import zope.configuration.fields
from zope.configuration.fields import GlobalObject, GlobalInterface
from zope.configuration.fields import Tokens, PythonIdentifier
import zope.interface
import zope.schema
from zope.interface import Interface
import zope.security.zcml
from zope.security.i18n import ZopeMessageFactory as _
from zope.security.zcml import Permission
class IClassDirective(zope.interface.Interface):
"""Make statements about a class"""
class_ = zope.configuration.fields.GlobalObject(
title=_("Class"),
required=True
)
class IImplementsSubdirective(zope.interface.Interface):
"""Declare that the class given by the content directive's class
attribute implements a given interface
"""
interface = zope.configuration.fields.Tokens(
title=_("One or more interfaces"),
required=True,
value_type=zope.configuration.fields.GlobalInterface()
)
class IRequireSubdirective(zope.interface.Interface):
"""Indicate that the a specified list of names or the names in a
given Interface require a given permission for access.
"""
permission = zope.security.zcml.Permission(
title=_("Permission"),
description=_("""
Specifies the permission by id that will be required to
access or mutate the attributes and methods specified."""),
required=False,
)
attributes = zope.configuration.fields.Tokens(
title=_("Attributes and methods"),
description=_("This is a list of attributes and methods"
" that can be accessed."),
required=False,
value_type=zope.configuration.fields.PythonIdentifier(),
)
set_attributes = zope.configuration.fields.Tokens(
title=_("Attributes that can be set"),
description=_("This is a list of attributes that can be"
" modified/mutated."),
required=False,
value_type=zope.configuration.fields.PythonIdentifier(),
)
interface = zope.configuration.fields.Tokens(
title=_("Interfaces"),
description=_("The listed interfaces' methods and attributes"
" can be accessed."),
required=False,
value_type=zope.configuration.fields.GlobalInterface(),
)
set_schema = zope.configuration.fields.Tokens(
title=_("The attributes specified by the schema can be set"),
description=_("The listed schemas' properties can be"
" modified/mutated."),
required=False,
value_type=zope.configuration.fields.GlobalInterface(),
)
like_class = zope.configuration.fields.GlobalObject(
title=_("Configure like this class"),
description=_("""
This argument says that this content class should be configured in the
same way the specified class' security is. If this argument is
specified, no other argument can be used."""),
required=False,
)
class IAllowSubdirective(zope.interface.Interface):
"""
Declare a part of the class to be publicly viewable (that is,
requires the zope.Public permission). Only one of the following
two attributes may be used.
"""
attributes = zope.configuration.fields.Tokens(
title=_("Attributes"),
required=False,
value_type=zope.configuration.fields.PythonIdentifier(),
)
interface = zope.configuration.fields.Tokens(
title=_("Interface"),
required=False,
value_type=zope.configuration.fields.GlobalInterface(),
)
class IFactorySubdirective(zope.interface.Interface):
"""Specify the factory used to create this content object"""
id = zope.schema.Id(
title=_("ID"),
description=_("""
the identifier for this factory in the ZMI factory
identification scheme. If not given, defaults to the literal
string given as the content directive's 'class' attribute."""),
required=False,
)
title = zope.configuration.fields.MessageID(
title=_("Title"),
description=_("Text suitable for use in the 'add content' menu"
" of a management interface"),
required=False,
)
description = zope.configuration.fields.MessageID(
title=_("Description"),
description=_("Longer narrative description of what this"
" factory does"),
required=False,
)
class IModule(Interface):
"""Group security declarations about a module"""
module = GlobalObject(
title=u"Module",
description=u"Pointer to the module object.",
required=True)
class IAllow(Interface):
"""Allow access to selected module attributes
Access is unconditionally allowed to any names provided directly
in the attributes attribute or to any names defined by
interfaces listed in the interface attribute.
"""
attributes = Tokens(
title=u"Attributes",
description=u"The attributes to provide access to.",
value_type = PythonIdentifier(),
required=False)
interface = Tokens(
title=u"Interface",
description=u"Interfaces whos names to provide access to. Access "
u"will be provided to all of the names defined by the "
u"interface(s). Multiple interfaces can be supplied.",
value_type = GlobalInterface(),
required=False)
class IRequire(Interface):
"""Require a permission to access selected module attributes
The given permission is required to access any names provided
directly in the attributes attribute or any names defined by
interfaces listed in the interface attribute.
"""
attributes = Tokens(
title=u"Attributes",
description=u"The attributes to require permission for.",
value_type = PythonIdentifier(),
required=False)
permission = Permission(
title=u"Permission ID",
description=u"The id of the permission to require.")
|