/
components.py
37 lines (29 loc) · 1.28 KB
/
components.py
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
##############################################################################
#
# Copyright (c) 2006-2007 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.
#
##############################################################################
"""Grok components"""
from zope.security.permission import Permission
class Permission(Permission):
pass
Public = 'zope.Public'
from zope.securitypolicy.role import Role as securitypolicy_Role
class Role(securitypolicy_Role):
"""Base class for roles in Grok applications.
A role is a description of a class of users that gives them a
machine-readable name, a human-readable title, and a set of
permissions which users belong to that role should possess::
class Editor(grok.Role):
grok.name('news.Editor')
grok.title('Editor')
grok.permissions('news.EditArticle', 'news.PublishArticle')
"""