~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/app/interfaces/security.py

[r=henninge][bug=766955][incr] Mechanical change to move
 AuthorizationBase into lp.app.security.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2011 Canonical Ltd.  This software is licensed under the
 
2
# GNU Affero General Public License version 3 (see the file LICENSE).
 
3
 
 
4
"""Interfaces for the Launchpad security policy."""
 
5
 
 
6
__metaclass__ = type
 
7
 
 
8
__all__ = [
 
9
    'IAuthorization',
 
10
    ]
 
11
 
 
12
from zope.interface import Interface
 
13
 
 
14
 
 
15
class IAuthorization(Interface):
 
16
    """Authorization policy for a particular object and permission."""
 
17
 
 
18
    def checkUnauthenticated():
 
19
        """Returns True if an unauthenticated user has that permission
 
20
        on the adapted object.  Otherwise returns False.
 
21
        """
 
22
 
 
23
    def checkAccountAuthenticated(account):
 
24
        """Returns True if the account has that permission on the adapted
 
25
        object.  Otherwise returns False.
 
26
 
 
27
        The argument `account` is the account who is authenticated.
 
28
        """