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
5ec51bc1
Commit
5ec51bc1
authored
Jun 05, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop using the Products packages as a data container for __ac_permissions__
parent
531882a5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
17 deletions
+10
-17
AC-vs-DTML-TODO.txt
AC-vs-DTML-TODO.txt
+0
-4
src/AccessControl/Permission.py
src/AccessControl/Permission.py
+4
-5
src/AccessControl/Role.py
src/AccessControl/Role.py
+6
-8
No files found.
AC-vs-DTML-TODO.txt
View file @
5ec51bc1
...
@@ -25,10 +25,6 @@ AccessControl
...
@@ -25,10 +25,6 @@ AccessControl
* OFS - as a base class for User.BaseUserFolder
* OFS - as a base class for User.BaseUserFolder
* Products (in registerPermissions using it as a data container for
``__ac_permissions__``) - this should use a global inside the module
inside AccessControl.
* App (MessageDialog, DTMLFile, ...) - all need to go - redoing the UI is
* App (MessageDialog, DTMLFile, ...) - all need to go - redoing the UI is
hard. We probably need to move it into some other core part of Zope2, like
hard. We probably need to move it into some other core part of Zope2, like
the App package, which could serve as a general dumping ground for ZMI
the App package, which could serve as a general dumping ground for ZMI
...
...
src/AccessControl/Permission.py
View file @
5ec51bc1
...
@@ -139,11 +139,11 @@ class Permission:
...
@@ -139,11 +139,11 @@ class Permission:
_registeredPermissions
=
{}
_registeredPermissions
=
{}
_ac_permissions
=
()
def
getPermissions
():
def
getPermissions
():
import
Products
return
_ac_permissions
return
getattr
(
Products
,
'__ac_permissions__'
,
())
def
addPermission
(
perm
,
default_roles
=
(
'Manager'
,
)):
def
addPermission
(
perm
,
default_roles
=
(
'Manager'
,
)):
...
@@ -151,9 +151,8 @@ def addPermission(perm, default_roles=('Manager', )):
...
@@ -151,9 +151,8 @@ def addPermission(perm, default_roles=('Manager', )):
return
return
entry
=
((
perm
,
(),
default_roles
),
)
entry
=
((
perm
,
(),
default_roles
),
)
import
Products
global
_ac_permissions
Products_permissions
=
getPermissions
()
_ac_permissions
=
_ac_permissions
+
entry
Products
.
__ac_permissions__
=
Products_permissions
+
entry
_registeredPermissions
[
perm
]
=
1
_registeredPermissions
[
perm
]
=
1
mangled
=
pname
(
perm
)
# get mangled permission name
mangled
=
pname
(
perm
)
# get mangled permission name
if
not
hasattr
(
ApplicationDefaultPermissions
,
mangled
):
if
not
hasattr
(
ApplicationDefaultPermissions
,
mangled
):
...
...
src/AccessControl/Role.py
View file @
5ec51bc1
...
@@ -600,7 +600,6 @@ class RoleManager(Base, RoleManager):
...
@@ -600,7 +600,6 @@ class RoleManager(Base, RoleManager):
smallRolesWidget
=
selectedRoles
=
aclAChecked
=
aclPChecked
=
aclEChecked
=
''
smallRolesWidget
=
selectedRoles
=
aclAChecked
=
aclPChecked
=
aclEChecked
=
''
validRoles
=
valid_roles
validRoles
=
valid_roles
#manage_rolesForm=manage_access
def
manage_editRoles
(
self
,
REQUEST
,
acl_type
=
'A'
,
acl_roles
=
[]):
def
manage_editRoles
(
self
,
REQUEST
,
acl_type
=
'A'
,
acl_roles
=
[]):
pass
pass
...
@@ -609,16 +608,15 @@ class RoleManager(Base, RoleManager):
...
@@ -609,16 +608,15 @@ class RoleManager(Base, RoleManager):
pass
pass
def
possible_permissions
(
self
):
def
possible_permissions
(
self
):
d
=
{}
d
=
{}
Products_
permissions
=
getPermissions
()
permissions
=
getPermissions
()
for
p
in
Products_
permissions
:
for
p
in
permissions
:
d
[
p
[
0
]]
=
1
d
[
p
[
0
]]
=
1
for
p
in
self
.
ac_inherited_permissions
(
1
):
for
p
in
self
.
ac_inherited_permissions
(
1
):
d
[
p
[
0
]]
=
1
d
[
p
[
0
]]
=
1
d
=
d
.
keys
()
d
=
d
.
keys
()
d
.
sort
()
d
.
sort
()
return
d
return
d
InitializeClass
(
RoleManager
)
InitializeClass
(
RoleManager
)
...
...
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