1

I would like to give an admin user (not User 1) permission to see the Recent Log Messages (/admin/reports/dblog), but I only want him to see 'User' logs. As it is a subscription website he could see who has been signing up and cancelling their accounts. But if I was to give them this permission, they will also be able to see all the other log messages, which I do not want them to see.

I have searched for a module that allows permissions by Log Type (access denied/cron/page not found/etc.) , but with no luck. My best idea is if there was a way to create a View of the recent log messages, I could then create a filter to only show User messages.

Is there a module or some hook where I can limit a users access to 'Recent log messages' by 'Type'?

1 Answer 1

2

In Drupal 8, you can simply create a view of "Log entries". Just make sure you add a "Type" filter and select "user" as the type.

Then under "Page settings", change the "Access: Permission" to "Role > Administrator". However, if you don't want this user to view other log messages, perhaps that user shouldn't be an administrator? I recommend creating a new role for that type of user.

In Drupal 7, the Views module doesn't allow you to make a view of log entries out-of-the-box, however if you install the Views Watchdog module, you can do it just like the Drupal 8 method described above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.