/** * Sets the social network. * * @param group the group * @param publicVisibility the public visibility * @param snVisibility the sn visibility * @return the social network */ private SocialNetwork setSocialNetwork( final Group group, final GroupListMode publicVisibility, final SocialNetworkVisibility snVisibility) { final SocialNetwork network = group.getSocialNetwork(); final AccessLists lists = network.getAccessLists(); lists.getViewers().setMode(publicVisibility); network.setVisibility(snVisibility); return network; }
/** * Correct member. * * @param user the user * @param group the group * @param memberType the member type * @return true, if successful */ public static boolean correctMember( final User user, final Group group, final AccessRol memberType) { final AccessRights accessRights = rightsService.get(user, group.getSocialNetwork().getAccessLists()); switch (memberType) { case Administrator: return accessRights.isAdministrable(); case Editor: return accessRights.isEditable(); default: return accessRights.isVisible(); } }