[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security/Grants - ILocalSecurityMap.py:1.1 LocalSecurityMap.py:1.2

Florent Guillaume fg@nuxeo.com
Mon, 24 Jun 2002 06:31:44 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/Security/Grants
In directory cvs.zope.org:/tmp/cvs-serv16850

Modified Files:
	LocalSecurityMap.py 
Added Files:
	ILocalSecurityMap.py 
Log Message:
Add an interface for LocalSecurityMap, and test.


=== Added File Zope3/lib/python/Zope/App/Security/Grants/ILocalSecurityMap.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
# 
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (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.
# 
##############################################################################
"""Security map to hold matrix-like relationships."""

from Interface import Interface


class ILocalSecurityMap(Interface):
    """Security map to hold matrix-like relationships."""

    def addCell(rowentry, colentry, value):
        " add a cell "

    def delCell(rowentry, colentry):
        " delete a cell "

    # XXX queryCell / getCell ?
    def getCell(rowentry, colentry, default=None):
        " return the value of a cell by row, entry "

    def getRow(rowentry):
        " return a list of (colentry, value) tuples from a row "

    def getCol(colentry):
        " return a list of (rowentry, value) tuples from a col "

    def getAllCells():
        " return a list of (rowentry, colentry, value) "


=== Zope3/lib/python/Zope/App/Security/Grants/LocalSecurityMap.py 1.1 => 1.2 ===
 """ Generic three dimensional array type """
 
+from Zope.App.Security.Grants.ILocalSecurityMap import ILocalSecurityMap
 
 class LocalSecurityMap(object):
-   
+
+    __implements__ = ILocalSecurityMap
+
     def __init__(self):
         self._clear()