[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security - IPrincipalRoleMap.py:1.1.2.1
Barry Warsaw
barry@wooz.org
Thu, 13 Dec 2001 16:00:21 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security
In directory cvs.zope.org:/tmp/cvs-serv32612
Added Files:
Tag: Zope-3x-branch
IPrincipalRoleMap.py
Log Message:
Query interface for mappings between principals and roles.
=== Added File Zope3/lib/python/Zope/App/Security/IPrincipalRoleMap.py ===
# IPrincipalRoleMap.py
#
# Copyright (c) 2001 Zope Coporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 1.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.
"""Query interface for mappings between principals and roles."""
from Interface import Interface
class IPrincipalRoleMap(Interface):
"""Mappings between principals and roles."""
def getPrincipalsForRole(role):
"""Return the list of principals who have been assigned role.
role must be an IRole. If no principals have been assigned this role,
then the empty list is returned.
"""
def getRolesForPrincipal(principal):
"""Return the list of roles assigned to this principal.
principal must be an IPrincipal. If no roles have been assigned to
this principal, then the empty list is returned.
"""