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
* 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
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
...
...
src/AccessControl/Permission.py
View file @
5ec51bc1
...
...
@@ -139,11 +139,11 @@ class Permission:
_registeredPermissions
=
{}
_ac_permissions
=
()
def
getPermissions
():
import
Products
return
getattr
(
Products
,
'__ac_permissions__'
,
())
return
_ac_permissions
def
addPermission
(
perm
,
default_roles
=
(
'Manager'
,
)):
...
...
@@ -151,9 +151,8 @@ def addPermission(perm, default_roles=('Manager', )):
return
entry
=
((
perm
,
(),
default_roles
),
)
import
Products
Products_permissions
=
getPermissions
()
Products
.
__ac_permissions__
=
Products_permissions
+
entry
global
_ac_permissions
_ac_permissions
=
_ac_permissions
+
entry
_registeredPermissions
[
perm
]
=
1
mangled
=
pname
(
perm
)
# get mangled permission name
if
not
hasattr
(
ApplicationDefaultPermissions
,
mangled
):
...
...
src/AccessControl/Role.py
View file @
5ec51bc1
...
...
@@ -600,7 +600,6 @@ class RoleManager(Base, RoleManager):
smallRolesWidget
=
selectedRoles
=
aclAChecked
=
aclPChecked
=
aclEChecked
=
''
validRoles
=
valid_roles
#manage_rolesForm=manage_access
def
manage_editRoles
(
self
,
REQUEST
,
acl_type
=
'A'
,
acl_roles
=
[]):
pass
...
...
@@ -609,16 +608,15 @@ class RoleManager(Base, RoleManager):
pass
def
possible_permissions
(
self
):
d
=
{}
Products_
permissions
=
getPermissions
()
for
p
in
Products_
permissions
:
d
[
p
[
0
]]
=
1
d
=
{}
permissions
=
getPermissions
()
for
p
in
permissions
:
d
[
p
[
0
]]
=
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
()
return
d
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