String remoteUser = pcontext.getRemoteUser();
if (remoteUser == null) {
return false;
}
UserACL userACL = this.getApplicationComponent(UserACL.class);
if (userACL.isUserInGroup(userACL.getAdminGroups())) {
return true;
}
OrganizationService orgService = this.getApplicationComponent(OrganizationService.class);
try {
Collection<?> groups = orgService.getGroupHandler().findGroupByMembership(remoteUser, userACL.getMakableMT());
return groups != null && groups.size() > 0;
} catch (Exception ex) {
return false;
}
}