Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
4ab8bc44
Commit
4ab8bc44
authored
Dec 11, 2000
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
final fixup to SecurityInfo interface names
parent
2c299351
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
8 deletions
+30
-8
lib/python/AccessControl/SecurityInfo.py
lib/python/AccessControl/SecurityInfo.py
+30
-8
No files found.
lib/python/AccessControl/SecurityInfo.py
View file @
4ab8bc44
...
...
@@ -88,7 +88,11 @@
a declarative style of associating access control information
with class attributes.
add example here
More information on using SecurityInfo and guide to Zope security
for developers can be found in the dev.zope.org "Declarative Security"
project:
http://dev.zope.org/Wikis/DevSite/Projects/DeclarativeSecurity
While SecurityInfo objects largely remove the need for Python
programmers to care about the underlying implementation, there
...
...
@@ -144,21 +148,36 @@ class SecurityInfo(Acquisition.Implicit):
self
.
_warnings
=
1
self
.
names
[
name
]
=
access
p
ublic__roles__
=
ACCESS_PRIVATE
def
p
ublic
(
self
,
*
names
):
declareP
ublic__roles__
=
ACCESS_PRIVATE
def
declareP
ublic
(
self
,
*
names
):
"""Declare names to be publicly accessible."""
self
.
_setaccess
(
names
,
ACCESS_PUBLIC
)
p
rivate__roles__
=
ACCESS_PRIVATE
def
p
rivate
(
self
,
*
names
):
declareP
rivate__roles__
=
ACCESS_PRIVATE
def
declareP
rivate
(
self
,
*
names
):
"""Declare names to be inaccessible to restricted code."""
self
.
_setaccess
(
names
,
ACCESS_PRIVATE
)
p
rotected__roles__
=
ACCESS_PRIVATE
def
p
rotected
(
self
,
permission_name
,
*
names
):
declareP
rotected__roles__
=
ACCESS_PRIVATE
def
declareP
rotected
(
self
,
permission_name
,
*
names
):
"""Declare names to be associated with a permission."""
self
.
_setaccess
(
names
,
permission_name
)
objectPublic__roles__
=
ACCESS_PRIVATE
def
objectPublic
(
self
):
"""Declare names to be publicly accessible."""
self
.
_setaccess
((),
ACCESS_PUBLIC
)
objectPrivate__roles__
=
ACCESS_PRIVATE
def
objectPrivate
(
self
):
"""Declare names to be inaccessible to restricted code."""
self
.
_setaccess
((),
ACCESS_PRIVATE
)
objectProtected__roles__
=
ACCESS_PRIVATE
def
objectProtected
(
self
,
permission_name
):
"""Declare names to be associated with a permission."""
self
.
_setaccess
((),
permission_name
)
setDefaultRoles__roles__
=
ACCESS_PRIVATE
def
setDefaultRoles
(
self
,
permission_name
,
roles
):
"""Declare default roles for a permission"""
...
...
@@ -180,6 +199,7 @@ class SecurityInfo(Acquisition.Implicit):
"""
self
.
access
=
access
class
ClassSecurityInfo
(
SecurityInfo
):
"""Encapsulate security information for class objects."""
...
...
@@ -288,10 +308,12 @@ class ModuleSecurityInfo(SecurityInfo):
LOG
(
'SecurityInfo'
,
WARNING
,
'Module "%s" had conflicting '
'security declarations'
%
dict
[
'__name__'
])
def
protected
(
self
,
permission_name
,
*
names
):
declareProtected__roles__
=
ACCESS_PRIVATE
def
declareProtected
(
self
,
permission_name
,
*
names
):
"""Cannot declare module names protected."""
pass
setDefaultRoles__roles__
=
ACCESS_PRIVATE
def
setDefaultRoles
(
self
,
permission_name
,
roles
):
"""Cannot set default roles for permissions in a module."""
pass
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment