protected void beforeDelete(ModeledAuthenticatedUser user,
            String identifier) throws GuacamoleException {

        // Verify permission to delete objects
        if (!hasObjectPermission(user, identifier, ObjectPermission.Type.DELETE))
            throw new GuacamoleSecurityException("Permission denied.");

    }
Called before any object is deleted through this directory object
service. This function serves as a final point of validation before
the delete operation occurs. In its default implementation,
beforeDelete() performs basic permissions checks.

@param user
    The user deleting the existing object.

@param identifier
    The identifier of the object being deleted.

@throws GuacamoleException
    If the object is invalid, or an error prevents validating the given
    object.
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/base/ModeledDirectoryObjectService.java