コード例 #1
0
ファイル: GroupManagerDefault.java プロジェクト: Odilio/kune
 /**
  * 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;
 }
コード例 #2
0
ファイル: AccessRightsUtils.java プロジェクト: Rutrus/kune
  /**
   * 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();
    }
  }