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
cbb99bc1
Commit
cbb99bc1
authored
Jul 02, 2001
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged getOwner optimizations from 2.4 branch
parent
4ddf6bed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
16 deletions
+24
-16
lib/python/AccessControl/Owned.py
lib/python/AccessControl/Owned.py
+18
-10
lib/python/AccessControl/SecurityManagement.py
lib/python/AccessControl/SecurityManagement.py
+3
-3
lib/python/AccessControl/SecurityManager.py
lib/python/AccessControl/SecurityManager.py
+3
-3
No files found.
lib/python/AccessControl/Owned.py
View file @
cbb99bc1
...
@@ -85,8 +85,8 @@
...
@@ -85,8 +85,8 @@
__doc__
=
'''Support for owned objects
__doc__
=
'''Support for owned objects
$Id: Owned.py,v 1.1
1 2001/04/27 20:27:37 shane
Exp $'''
$Id: Owned.py,v 1.1
2 2001/07/02 16:29:55 evan
Exp $'''
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
2
$'
[
11
:
-
2
]
import
Globals
,
urlparse
,
SpecialUsers
,
ExtensionClass
,
string
import
Globals
,
urlparse
,
SpecialUsers
,
ExtensionClass
,
string
from
AccessControl
import
getSecurityManager
,
Unauthorized
from
AccessControl
import
getSecurityManager
,
Unauthorized
...
@@ -135,7 +135,9 @@ class Owned(ExtensionClass.Base):
...
@@ -135,7 +135,9 @@ class Owned(ExtensionClass.Base):
getOwner__roles__
=
()
getOwner__roles__
=
()
def
getOwner
(
self
,
info
=
0
,
def
getOwner
(
self
,
info
=
0
,
aq_get
=
aq_get
,
None
=
None
,
UnownableOwner
=
UnownableOwner
,
aq_get
=
aq_get
,
None
=
None
,
UnownableOwner
=
UnownableOwner
,
getSecurityManager
=
getSecurityManager
,
):
):
"""Get the owner
"""Get the owner
...
@@ -143,19 +145,25 @@ class Owned(ExtensionClass.Base):
...
@@ -143,19 +145,25 @@ class Owned(ExtensionClass.Base):
returned. Otherwise, the owner object is returned.
returned. Otherwise, the owner object is returned.
"""
"""
owner
=
aq_get
(
self
,
'_owner'
,
None
,
1
)
owner
=
aq_get
(
self
,
'_owner'
,
None
,
1
)
if
owner
is
None
:
return
owner
if
info
or
(
owner
is
None
)
:
return
owner
if
info
:
return
owner
if
owner
is
UnownableOwner
:
return
None
if
owner
is
UnownableOwner
:
return
None
udb
,
oid
=
owner
udb
,
oid
=
owner
upath
=
(
''
,)
+
tuple
(
udb
)
+
(
oid
,)
objectCache
=
getSecurityManager
().
_context
.
objectCache
if
objectCache
.
has_key
(
upath
):
return
objectCache
[
upath
]
root
=
self
.
getPhysicalRoot
()
root
=
self
.
getPhysicalRoot
()
udb
=
root
.
unrestrictedTraverse
(
udb
,
None
)
udb
=
root
.
unrestrictedTraverse
(
udb
,
None
)
if
udb
is
None
:
return
SpecialUsers
.
nobody
if
udb
is
None
:
owner
=
udb
.
getUserById
(
oid
,
None
)
user
=
SpecialUsers
.
nobody
if
owner
is
None
:
return
SpecialUsers
.
nobody
else
:
return
owner
user
=
udb
.
getUserById
(
oid
,
None
)
if
user
is
None
:
user
=
SpecialUsers
.
nobody
objectCache
[
upath
]
=
user
return
user
changeOwnership__roles__
=
()
changeOwnership__roles__
=
()
def
changeOwnership
(
self
,
user
,
recursive
=
0
,
def
changeOwnership
(
self
,
user
,
recursive
=
0
,
...
...
lib/python/AccessControl/SecurityManagement.py
View file @
cbb99bc1
...
@@ -85,8 +85,8 @@
...
@@ -85,8 +85,8 @@
__doc__
=
'''short description
__doc__
=
'''short description
$Id: SecurityManagement.py,v 1.
3 2000/11/10 17:04:14 bri
an Exp $'''
$Id: SecurityManagement.py,v 1.
4 2001/07/02 16:29:55 ev
an Exp $'''
__version__
=
'$Revision: 1.
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
4
$'
[
11
:
-
2
]
import
SpecialUsers
import
SpecialUsers
from
SecurityManager
import
SecurityManager
from
SecurityManager
import
SecurityManager
...
@@ -139,6 +139,6 @@ class SecurityContext:
...
@@ -139,6 +139,6 @@ class SecurityContext:
def
__init__
(
self
,
user
):
def
__init__
(
self
,
user
):
self
.
stack
=
[]
self
.
stack
=
[]
self
.
user
=
user
self
.
user
=
user
self
.
objectCache
=
{}
lib/python/AccessControl/SecurityManager.py
View file @
cbb99bc1
...
@@ -85,8 +85,8 @@
...
@@ -85,8 +85,8 @@
__doc__
=
'''short description
__doc__
=
'''short description
$Id: SecurityManager.py,v 1.
4 2001/04/11 17:53:22
evan Exp $'''
$Id: SecurityManager.py,v 1.
5 2001/07/02 16:29:55
evan Exp $'''
__version__
=
'$Revision: 1.
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
5
$'
[
11
:
-
2
]
import
ZopeSecurityPolicy
,
os
,
string
import
ZopeSecurityPolicy
,
os
,
string
...
@@ -214,7 +214,7 @@ class SecurityManager:
...
@@ -214,7 +214,7 @@ class SecurityManager:
self
.
_policy
=
None
self
.
_policy
=
None
def
getUser
(
self
):
def
getUser
(
self
):
"""Ge
n
the current authenticated user"""
"""Ge
t
the current authenticated user"""
return
self
.
_context
.
user
return
self
.
_context
.
user
def
calledByExecutable
(
self
):
def
calledByExecutable
(
self
):
...
...
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