Yes, it can! Check out the "Secure download portal" example app at https://anvil.works/learn#examples - it's got group-based access control.
(Nothing magic - it's just a database. Even user records are just table rows, so you can link or categorise them however you like!)