Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There's currently no visibility to deletion activity outside of the DB. #1167

Closed
ezzra opened this issue Dec 9, 2018 · 6 comments
Closed

Comments

@ezzra
Copy link

ezzra commented Dec 9, 2018

If a page is deleted, no entry is added to the activity table but I think its also very much worth to mention this.

@ssddanbrown
Copy link
Member

Hi @ezzra,
Just tested this in my dev instance, Seemed to log a page_delete activity as expected. Such activity won't be logged if the page delete is performed by a book delete, since activity reflects user-actions.

image

If they still don't show for you please confirm the exact steps you're performing and I'll try to re-produce.

@ezzra
Copy link
Author

ezzra commented Dec 9, 2018

oops yes did not check this well enough, its actually in the DB tables but still does not show up in the web frontend. I guess that is because of the missing entity_id after the deletion. That is why also all page_create and page_update for this page vanish after deleting. Did not really test this because of time now, but its just looks like.

@ezzra
Copy link
Author

ezzra commented Dec 10, 2018

Ok I looked it up, it's because of the permissions, obviously the query can't check if a missing object has the necessary permissions, so this will not return the activities of deleted objects:

SELECT *
FROM `activities`
WHERE `book_id` = '1'
  AND (EXISTS
         (SELECT `id`
          FROM `joint_permissions`
          WHERE joint_permissions.entity_id=activities.entity_id
            AND joint_permissions.entity_type=activities.entity_type
            AND `action` = 'view'
            AND `role_id` IN ('1')
            AND (`has_permission` = '1'
                 OR (`has_permission_own` = '1'
                     AND `created_by` = '1'))))
ORDER BY `created_at` DESC
LIMIT 20
OFFSET 0

I'm afraid to fix that, one would have to change the delete process from real cascade deleting to updating the page with a "deleted=true" column.

@ssddanbrown
Copy link
Member

Yeah, This is kind of by design.

At some point it'd be nice to have a admin-area activity log 'Audit' view where they can see all activities otherwise they'd need to resort to the DB for now.

Otherwise we'd be looking to implement #1017 functionality to get to soft-deletes to keep related data, But you'd still have the same issues on permanent delete.

@ezzra
Copy link
Author

ezzra commented Dec 10, 2018

Otherwise we'd be looking to implement #1017

ah ok good to see that there already is an issue for that, I just wanted to propose that :)

But you'd still have the same issues on permanent delete.

yes true, but this might also be intended when using a permanent delete and there could be a warning/information about that. There could also be implemented a possibility to just remove the content but to keep the metadata. But I guess #1017 is the first and important step

@ssddanbrown ssddanbrown changed the title page deletion does not show up in activity stream There's currently no visibility to deletion activity outside of the DB. May 18, 2019
ssddanbrown added a commit that referenced this issue Sep 19, 2020
- Displays the currently tracked activities in the system.

Related to #2173 and #1167
@ssddanbrown ssddanbrown added this to the v0.30.0 milestone Sep 19, 2020
@ssddanbrown
Copy link
Member

As of v0.30, There will be an audit log interface included where delete events will be made visible without needing to access the database:

image

Therefore this specific request should be covered.
Thanks again @ezzra for the request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants