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
a6fb6824
Commit
a6fb6824
authored
Jan 08, 2006
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zLOG -> logging
parent
282104fb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
lib/python/AccessControl/ImplPython.py
lib/python/AccessControl/ImplPython.py
+4
-3
lib/python/AccessControl/SecurityInfo.py
lib/python/AccessControl/SecurityInfo.py
+7
-6
No files found.
lib/python/AccessControl/ImplPython.py
View file @
a6fb6824
...
...
@@ -15,13 +15,13 @@
import
os
import
string
from
logging
import
getLogger
from
Acquisition
import
aq_base
from
Acquisition
import
aq_parent
from
Acquisition
import
aq_inner
from
Acquisition
import
aq_acquire
from
ExtensionClass
import
Base
from
zLOG
import
LOG
,
BLATHER
,
PROBLEM
from
zope.interface
import
implements
# This is used when a permission maps explicitly to no permission. We
...
...
@@ -39,6 +39,7 @@ from AccessControl.interfaces import ISecurityManager
from
AccessControl.SimpleObjectPolicies
import
Containers
,
_noroles
from
AccessControl.ZopeGuards
import
guarded_getitem
LOG
=
getLogger
(
'ImplPython'
)
# AccessControl.PermissionRole
# ----------------------------
...
...
@@ -346,7 +347,7 @@ class ZopeSecurityPolicy:
return
1
except
TypeError
:
# 'roles' isn't a sequence
LOG
(
'Zope Security Policy'
,
PROBLEM
,
"'%s' passed as roles"
LOG
.
error
(
"'%s' passed as roles"
" during validation of '%s' is not a sequence."
%
(
`roles`
,
name
))
raise
...
...
@@ -804,7 +805,7 @@ def raiseVerbose(msg, accessed, container, name, value, context,
info
.
append
(
s
+
'.'
)
text
=
' '
.
join
(
info
)
LOG
(
'Zope Security Policy'
,
BLATHER
,
'Unauthorized: %s'
%
text
)
LOG
.
debug
(
'Unauthorized: %s'
%
text
)
raise
Unauthorized
(
text
)
def
getUserRolesInContext
(
user
,
context
):
...
...
lib/python/AccessControl/SecurityInfo.py
View file @
a6fb6824
...
...
@@ -39,11 +39,13 @@
"""
import
sys
from
logging
import
getLogger
import
Acquisition
from
AccessControl.ImplPython
import
_what_not_even_god_should_do
from
zLOG
import
LOG
,
WARNING
LOG
=
getLogger
(
'SecurityInfo'
)
# Security constants - these are imported into the AccessControl
...
...
@@ -69,8 +71,7 @@ class SecurityInfo(Acquisition.Implicit):
def
_setaccess
(
self
,
names
,
access
):
for
name
in
names
:
if
self
.
names
.
get
(
name
,
access
)
!=
access
:
LOG
(
'SecurityInfo'
,
WARNING
,
'Conflicting security '
'declarations for "%s"'
%
name
)
LOG
.
warn
(
'Conflicting security declarations for "%s"'
%
name
)
self
.
_warnings
=
1
self
.
names
[
name
]
=
access
...
...
@@ -111,7 +112,7 @@ class SecurityInfo(Acquisition.Implicit):
for
role
in
roles
:
rdict
[
role
]
=
1
if
self
.
roles
.
get
(
permission_name
,
rdict
)
!=
rdict
:
LOG
(
'SecurityInfo'
,
WARNING
,
'Conflicting default role'
LOG
.
warn
(
'Conflicting default role'
'declarations for permission "%s"'
%
permission_name
)
self
.
_warnings
=
1
self
.
roles
[
permission_name
]
=
rdict
...
...
@@ -193,7 +194,7 @@ class ClassSecurityInfo(SecurityInfo):
access
)
if
getattr
(
self
,
'_warnings'
,
None
):
LOG
(
'SecurityInfo'
,
WARNING
,
'Class "%s" had conflicting '
LOG
.
warn
(
'Class "%s" had conflicting '
'security declarations'
%
classobj
.
__name__
)
class
ClassSecurityInformation
(
ClassSecurityInfo
):
...
...
@@ -273,7 +274,7 @@ class _ModuleSecurityInfo(SecurityInfo):
dict
[
'__allow_access_to_unprotected_subobjects__'
]
=
self
if
getattr
(
self
,
'_warnings'
,
None
):
LOG
(
'SecurityInfo'
,
WARNING
,
'Module "%s" had conflicting '
LOG
.
warn
(
'Module "%s" had conflicting '
'security declarations'
%
dict
[
'__name__'
])
declareProtected__roles__
=
ACCESS_PRIVATE
...
...
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