Document Permission for everyone in the same group

AFAIK, At document level access, ERPNext / Frappe is only capable of User Permission (and not by any sort of Group Permission)

Says, if I want users from the same Department to have access to all documents of that Department (may be using department field in document), the only way is to use User Permission window to assign each Document to each User one by one?

Just want to confirm that I understand this correctly.

If so, are there any better way to auto assign such user permission in real time? I.e., as soon as the document is marked for that department, then do the permission thing.