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
bb5234e6
Commit
bb5234e6
authored
24 years ago
by
Chris McDonough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added roles argument to validate and validateValue methods.
parent
b4a35249
2.13
master
x/poll
y/cleanup-__del__
y/profile-fix
4.0a2
4.0a1
2.13.25
2.13.24
2.13.23
2.13.22
2.13.21
2.13.20
2.13.19
2.13.18
2.13.17
2.13.16
2.13.15
2.13.14
2.13.13
2.13.12
2.13.11
2.13.10
2.13.9
2.13.8
2.13.7
2.13.6
2.13.5
2.13.4
2.13.3
2.13.2
2.13.1
2.13.0
2.13.0c1
2.13.0b1
2.13.0a4
2.13.0a3
2.13.0a2
2.13.0a1
2.12.28
2.12.27
2.12.26
2.12.25
2.12.24
2.12.23
2.12.22
2.12.21
2.12.20
2.12.19
2.12.18
2.12.17
2.12.16
2.12.15
2.12.14
2.12.13
2.12.12
2.12.11
2.12.10
2.12.9
2.12.8
2.12.7
2.12.6
2.12.5
2.12.4
2.12.3
2.12.2
2.12.1
2.12.0
2.12.0c1
2.12.0b4
2.12.0b3
2.12.0b2
2.12.0b1
2.12.0a4
2.12.0a3
2.12.0a2
2.12.0a1
2.12-last-fulltree-revision
2.11.8
2.11.7
2.11.6
2.11.5
2.11.4
2.11.3
2.11.2
2.11.1
2.11.0
2.11.0c1
2.11.0b1
2.11.0a1
2.10.13
2.10.12
2.10.11
2.10.10
2.10.9
2.10.8
2.10.7
2.10.6
2.10.5
2.10.4
2.10.3
2.10.2
2.10.2b1
2.10.1
2.10.0
2.10.0c1
2.10.0b2
2.10.0b1
2.9.12
2.9.10
2.9.9
2.9.8
2.9.7
2.9.6
2.9.5
2.9.4
2.9.3
2.9.2
2.9.1
2.9.0
2.9.0b2
2.9.0b1
2.8.12
2.8.11
2.8.10
2.8.9.1
2.8.9
2-8-8
2-8-7
2-8-6
philikon-aq-checkpoint
cvs-to-svn-conversion
before-merging-console-scripts-branch
backups/2.10@68399
backups/2.10-with-ZODB3.8@83153
backups/zope33-port@68354
backups/zodb-blobs-branch@39746
backups/z4-zmi@124419
backups/witsch-zope2.11-with-standard-docutils@83154
backups/witsch-2.10-with-standard-docutils@76342
backups/tyam-unicodeSplitterPatch@104722
backups/tseaver-zope.app_delenda_est@110398
backups/tseaver-retire_zpkg@69009
backups/tseaver-retire_zpkg-2.10@69010
backups/tseaver-no_globals_imports@94459
backups/tseaver-instlib_as_site_dir@110397
backups/tseaver-five-integration-security@110396
backups/tseaver-five-integration-security@29697
backups/tseaver-collector_1774@40462
backups/tseaver-collector_1460@110395
backups/tseaver-clarify_install_docs@110394
backups/tseaver-catalog_getObject_raises@110393
backups/tseaver-2.11-no-z2-interfaces@110391
backups/tseaver-2.8-external_test@110392
backups/tseaver-2.8-external_test@29729
backups/tim-merge-zodb34@29764
backups/tim-2.9-windows-installer@41463
backups/slinkp_1726_zopeundo@40069
backups/slinkp-collector_1895@38740
backups/slinkp-collector_596@40067
backups/slinkp-1447-httpcache-fix-branch@67981
backups/shh-2.11-zopelitelayer@80865
backups/rochael-TM_sortKey@113726
backups/regebro-zopectl_shellfix@67835
backups/regebro-wsgi_refactor@67833
backups/regebro-unittest_docs@67835
backups/regebro-strftime_1127@67835
backups/regebro-issue_1888@67834
backups/philikon-zope32-integration@39849
backups/philikon-local-components@67666
backups/philikon-fix-lookup-priorities@66204
backups/philikon-deprecate-interfaces@68354
backups/jim-move-Zope@29064
backups/hannosch-dtml-vs-accesscontrol@113161
backups/gotcha-processlifetime@113938
backups/gotcha-LP143531@113945
backups/efge-five-events-work@40031
backups/easter-sprint_twistedserver@67155
backups/dc-large_file-branch@28340
backups/dc-bobo_traverse-branch@28330
backups/davisagli-copy-export@123222
backups/chrism-mountpoint@39745
backups/andig-catalog-report@115049
backups/ajung-zpt-strict-unicode@68335
backups/ajung-zpt-integration@68335
backups/ajung-zpt-end-game@68335
backups/ajung-zpt-encoding-fixes@71736
backups/ajung-zcatalog-progress@26609
backups/ajung-translatationservice@30288
backups/ajung-final-zpt-integration@68335
backups/ajung-epi-integration@29916
backups/ajung-2-11-prep-branch@82440
backups/acripps-resourceViewletDirective@75991
backups/Zope-2.9@40221
backups/Zope-2_9-branch@40220
ajung-final-zpt-integration-before-merge-savepoint
Zope-2.8.5
Zope-2-8-6
Zope-2-8-4
Zope-2-8-3
Zope-2-8-2
Zope-2-8-1
Zope-2-8-1-b1
Zope-2-8-0
Zope-2-8-0-b2
Zope-2-8-0-b1
Zope-2-8-0-a2
Zope-2-8-0-a1
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
lib/python/AccessControl/SecurityManager.py
lib/python/AccessControl/SecurityManager.py
+11
-6
No files found.
lib/python/AccessControl/SecurityManager.py
View file @
bb5234e6
...
...
@@ -85,11 +85,13 @@
__doc__
=
'''short description
$Id: SecurityManager.py,v 1.
2 2000/05/11 18:54:13 ji
m Exp $'''
__version__
=
'$Revision: 1.
2
$'
[
11
:
-
2
]
$Id: SecurityManager.py,v 1.
3 2001/01/10 20:20:46 chris
m Exp $'''
__version__
=
'$Revision: 1.
3
$'
[
11
:
-
2
]
import
ZopeSecurityPolicy
,
os
,
string
_noroles
=
ZopeSecurityPolicy
.
_noroles
try
:
max_stack_size
=
string
.
atoi
(
os
.
environ
.
get
(
'Z_MAX_STACK_SIZE'
,
'100'
))
except
:
max_stack_size
=
100
...
...
@@ -115,7 +117,8 @@ class SecurityManager:
self
.
_context
=
context
self
.
_policy
=
None
def
validate
(
self
,
accessed
=
None
,
container
=
None
,
name
=
None
,
value
=
None
):
def
validate
(
self
,
accessed
=
None
,
container
=
None
,
name
=
None
,
value
=
None
,
roles
=
_noroles
):
"""Validate access.
Arguments:
...
...
@@ -127,6 +130,8 @@ class SecurityManager:
name -- The name used to access the value
value -- The value retrieved though the access.
roles -- The roles of the object if already known.
The arguments may be provided as keyword arguments. Some of these
arguments may be ommitted, however, the policy may reject access
...
...
@@ -136,15 +141,15 @@ class SecurityManager:
policy
=
self
.
_policy
if
policy
is
None
:
policy
=
_defaultPolicy
return
policy
.
validate
(
accessed
,
container
,
name
,
value
,
self
.
_context
)
self
.
_context
,
roles
)
def
validateValue
(
self
,
value
):
def
validateValue
(
self
,
value
,
roles
=
_noroles
):
"""Convenience for common case of simple value validation.
"""
policy
=
self
.
_policy
if
policy
is
None
:
policy
=
_defaultPolicy
return
policy
.
validate
(
None
,
None
,
None
,
value
,
self
.
_context
)
self
.
_context
,
roles
)
def
checkPermission
(
self
,
permission
,
object
):
"""Check whether the security context allows the given permission on
...
...
This diff is collapsed.
Click to expand it.
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