@Transient public boolean isViewPerm(Collection<MemberGroup> groups, Collection<Org> orgs) { if (Reflections.containsAny(getViewGroups(), groups, "id")) { return true; } if (CollectionUtils.isNotEmpty(orgs) && Reflections.containsAny(getViewOrgs(), orgs, "id")) { return true; } return false; }
@Transient public boolean isContriPerm(User user, Collection<MemberGroup> groups) { if (!getRealNode()) { // 不是真实节点(没有信息的节点)不允许投稿 return false; } Set<MemberGroup> contriGroups = getContriGroups(); return Reflections.containsAny(contriGroups, groups, "id"); }
@Transient public boolean isDataPerm(User user) { Integer siteId = getSite().getId(); if (user.getAllNodePerm(siteId) || Reflections.contains(user.getNodePerms(siteId), getId(), "id")) { return true; } return false; }