You should use [`PatientAccess.getOwner()`](https://github.com/phenotips/phenotips/blob/master/components/patient-access-rules/api/src/main/java/org/phenotips/data/permissions/PatientAccess.java#L36) instead; that can be either a user or a group, so create two different submethods to deal with each case.