E&S CVS Commit: PEAK - Streamlined security API. Permission-checking methods just accept an

pje at eby-sarna.com pje at eby-sarna.com
Thu Jun 26 19:15:00 EDT 2003


Module Name:	PEAK
Committed By:	pje
Date:		Thu Jun 26 23:14:19 UTC 2003

Modified Files:
	PEAK/src/peak/security: interfaces.py permission.py
	PEAK/src/peak/security/tests: permission.py

Log Message:
Streamlined security API.  Permission-checking methods just accept an
'attempt' now, and each 'attempt' deals with exactly one (concrete)
permission.  Attempts now have an 'allows()' method with almost the same
signature as IInteraction.allows(), but with all arguments defaulting to
the values in the attempt.  This replaces the 'attempt.new().isAllowed()'
idiom that was used before.  Merged 'IGuardedObject' and
'INamePermissions', so that now a name of 'None' is used to identify a
permission on the object itself (as opposed to permissions on its
contents).  This simplifies the API and cuts back on the number of
interfaces defined.  Also, because it's now handled by the interaction, it
could actually become a contextual protocol, allowing multiple apps to
define different permissions for the same base classes.  (Although then
we'd need another API function to do the declaration.)


To view diffs of this commit, you can use the following URL(s):
http://cvs.eby-sarna.com/PEAK/src/peak/security/interfaces.py.diff?r1=1.3&r2=1.4
http://cvs.eby-sarna.com/PEAK/src/peak/security/permission.py.diff?r1=1.3&r2=1.4
http://cvs.eby-sarna.com/PEAK/src/peak/security/tests/permission.py.diff?r1=1.3&r2=1.4

To generate a diff of this commit:
cvs rdiff -r1.3 -r1.4 PEAK/src/peak/security/interfaces.py \
    PEAK/src/peak/security/permission.py
cvs rdiff -r1.3 -r1.4 PEAK/src/peak/security/tests/permission.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




More information about the source-changes mailing list