ASF Bugzilla – Attachment 13065 Details for
Bug 31696
Throw events when setting new permissions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Enhances the implementation of SecurityImpl.setPermissions()
SecurityImpl.java (text/plain), 2.46 KB, created by
Stefan Fromm
on 2004-10-13 10:20:49 UTC
(
hide
)
Description:
Enhances the implementation of SecurityImpl.setPermissions()
Filename:
MIME Type:
Creator:
Stefan Fromm
Created:
2004-10-13 10:20:49 UTC
Size:
2.46 KB
patch
obsolete
>Index: src/share/org/apache/slide/security/SecurityImpl.java >=================================================================== >RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/security/SecurityImpl.java,v >retrieving revision 1.55 >diff -r1.55 SecurityImpl.java >146c146 >< AccessDeniedException { >--- >> AccessDeniedException, VetoException { >154a155,164 >> >> // Diff permissions >> Enumeration oldPermissions = >> objectUri.getStore().enumeratePermissions(objectUri); >> Vector oldPermissionVector = new Vector(); >> while ( oldPermissions.hasMoreElements() ) >> oldPermissionVector.add(oldPermissions.nextElement()); >> Vector newPermissionVector = new Vector(); >> while (permissions.hasMoreElements()) >> newPermissionVector.add(permissions.nextElement()); >155a166,171 >> Vector removedPermissions = new Vector(oldPermissionVector); >> removedPermissions.removeAll(newPermissionVector); >> Vector addedPermissions = new Vector(newPermissionVector); >> addedPermissions.removeAll(oldPermissionVector); >> >> // Set permissions >157a174 >> permissions = newPermissionVector.elements(); >163a181,200 >> // Fire events >> permissions = removedPermissions.elements(); >> while ( permissions.hasMoreElements() ) >> { >> NodePermission permission = >> (NodePermission)permissions.nextElement(); >> if ( SecurityEvent.REVOKE_PERMISSION.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(SecurityEvent.REVOKE_PERMISSION, new SecurityEvent(this, token, namespace, objectUri, permission)); >> } >> permissions = addedPermissions.elements(); >> while ( permissions.hasMoreElements() ) >> { >> NodePermission permission = >> (NodePermission)permissions.nextElement(); >> if ( permission.isNegative() ) { >> if ( SecurityEvent.DENY_PERMISSION.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(SecurityEvent.DENY_PERMISSION, new SecurityEvent(this, token, namespace, objectUri, permission)); >> } else { >> if ( SecurityEvent.GRANT_PERMISSION.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(SecurityEvent.GRANT_PERMISSION, new SecurityEvent(this, token, namespace, objectUri, permission)); >> } >> >> }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 31696
:
13064
| 13065