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
72b16754
Commit
72b16754
authored
Jul 28, 2007
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More proper usage of the aq_* methods
parent
e297e2f8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
lib/python/AccessControl/Permission.py
lib/python/AccessControl/Permission.py
+2
-2
lib/python/AccessControl/User.py
lib/python/AccessControl/User.py
+6
-4
No files found.
lib/python/AccessControl/Permission.py
View file @
72b16754
...
@@ -17,6 +17,7 @@ $Id$
...
@@ -17,6 +17,7 @@ $Id$
import
string
,
Products
,
Globals
import
string
,
Products
,
Globals
from
Acquisition
import
aq_base
name_trans
=
filter
(
lambda
c
,
an
=
string
.
letters
+
string
.
digits
+
'_'
:
c
not
in
an
,
name_trans
=
filter
(
lambda
c
,
an
=
string
.
letters
+
string
.
digits
+
'_'
:
c
not
in
an
,
map
(
chr
,
range
(
256
)))
map
(
chr
,
range
(
256
)))
...
@@ -36,8 +37,7 @@ class Permission:
...
@@ -36,8 +37,7 @@ class Permission:
self
.
name
=
name
self
.
name
=
name
self
.
_p
=
'_'
+
string
.
translate
(
name
,
name_trans
)
+
"_Permission"
self
.
_p
=
'_'
+
string
.
translate
(
name
,
name_trans
)
+
"_Permission"
self
.
data
=
data
self
.
data
=
data
if
hasattr
(
obj
,
'aq_base'
):
obj
=
obj
.
aq_base
self
.
obj
=
aq_base
(
obj
)
self
.
obj
=
obj
self
.
default
=
default
self
.
default
=
default
def
getRoles
(
self
,
default
=
_marker
):
def
getRoles
(
self
,
default
=
_marker
):
...
...
lib/python/AccessControl/User.py
View file @
72b16754
...
@@ -20,6 +20,8 @@ import re
...
@@ -20,6 +20,8 @@ import re
import
socket
import
socket
from
base64
import
decodestring
from
base64
import
decodestring
from
Acquisition
import
aq_base
from
Acquisition
import
aq_parent
from
Acquisition
import
aq_inContextOf
from
Acquisition
import
aq_inContextOf
from
Acquisition
import
Implicit
from
Acquisition
import
Implicit
from
App.Management
import
Navigation
,
Tabs
from
App.Management
import
Navigation
,
Tabs
...
@@ -152,7 +154,7 @@ class BasicUser(Implicit):
...
@@ -152,7 +154,7 @@ class BasicUser(Implicit):
if
getattr
(
parent
,
'__parent__'
,
None
)
is
not
None
:
if
getattr
(
parent
,
'__parent__'
,
None
)
is
not
None
:
while
hasattr
(
parent
.
aq_self
,
'aq_self'
):
while
hasattr
(
parent
.
aq_self
,
'aq_self'
):
parent
=
parent
.
aq_self
parent
=
parent
.
aq_self
parent
=
parent
.
__parent__
parent
=
aq_parent
(
parent
)
else
:
return
r
else
:
return
r
def
_check_context
(
self
,
object
):
def
_check_context
(
self
,
object
):
...
@@ -772,7 +774,7 @@ class BasicUserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager,
...
@@ -772,7 +774,7 @@ class BasicUserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager,
def
_isTop
(
self
):
def
_isTop
(
self
):
try
:
try
:
return
self
.
__parent__
.
aq_base
.
isTopLevelPrincipiaApplicationObject
return
aq_base
(
aq_parent
(
self
))
.
isTopLevelPrincipiaApplicationObject
except
:
except
:
return
0
return
0
...
@@ -987,8 +989,8 @@ class BasicUserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager,
...
@@ -987,8 +989,8 @@ class BasicUserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager,
def
manage_afterAdd
(
self
,
item
,
container
):
def
manage_afterAdd
(
self
,
item
,
container
):
if
item
is
self
:
if
item
is
self
:
if
hasattr
(
self
,
'aq_base'
):
self
=
self
.
aq_base
self
=
aq_base
(
self
)
container
.
__allow_groups__
=
self
container
.
__allow_groups__
=
self
def
__creatable_by_emergency_user__
(
self
):
return
1
def
__creatable_by_emergency_user__
(
self
):
return
1
...
...
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