Hello,
I wanna use the events of Slide and I have a few issues.
1) There is not fired a WebdavEvent with WebdavEvent.LOCK method in LockMethod.executeRequest()
2) SecurityEvent and LockEvent don't allow to access the objectUri by a getter. It would be nice to have like in the other events StructureEvent, ContentEvent and MacroEvent.
3) AclMethod doesn't entail SecurityEvent.GRANT_PERMISSION, SecurityEvent.REVOKE_PERMISSION and SecurityEvent.DENY_PERMISSION because the called method SecurityImpl.setPermissions() doesn't call these events. For this I attached a patch. All what is left to do is to declare the VetoException in the interface method Security.setPermissions()
Regards Stefan
public void setPermissions(SlideToken token, String object, Enumeration permissions) throws ServiceAccessException, ObjectNotFoundException, AccessDeniedException, VetoException { Uri objectUri = namespace.getUri(token, object); ObjectNode objectNode = objectUri.getStore().retrieveObject(objectUri); checkCredentials(token, objectNode, namespaceConfig.getGrantPermissionAction()); checkCredentials(token, objectNode, namespaceConfig.getRevokePermissionAction());
// 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()); Vector removedPermissions = new Vector(oldPermissionVector); removedPermissions.removeAll(newPermissionVector); Vector addedPermissions = new Vector(newPermissionVector); addedPermissions.removeAll(oldPermissionVector); // Set permissions objectUri.getStore().revokePermissions(objectUri); permissions = newPermissionVector.elements(); while (permissions.hasMoreElements()) { NodePermission permission = (NodePermission) permissions.nextElement(); objectUri.getStore().grantPermission(objectUri, permission); } // 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)); } } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]