示例#1
0
# -*- coding: utf-8 -*-
"""
Authorization controls for mock app 2.

"""

from repoze.what.acl import ACL

control = ACL("/app2")
control.deny("/secret", reason="This is a secret")
示例#2
0
# -*- coding: utf-8 -*-
"""
Authorization controls for the mock App 1.

"""

from repoze.what.acl import ACL

silly_denial_handler = lambda request, denial_reason: "No! %s" % denial_reason

control = ACL("/app1")
control.allow("/blog")
control.deny("/admin", denial_handler=silly_denial_handler, reason="Get out!")