1

added functionality to choose wether group is private or open

This commit is contained in:
killerber4t
2020-03-14 11:50:52 +01:00
parent 3d7681fc8f
commit d3c5ded6d0
3 changed files with 28 additions and 18 deletions

View File

@ -26,10 +26,15 @@ public class ControllerService {
* @param title Gruppentitel
* @param description Gruppenbeschreibung
*/
public void createGroup(Account account, String title, String description) {
public void createGroup(Account account, String title, String description, Boolean visibility) {
Visibility visibility1;
if (visibility){
visibility1 = Visibility.PUBLIC;
}else{
visibility1 = Visibility.PRIVATE;
}
List<Event> eventList = new ArrayList<>();
Collections.addAll(eventList, new CreateGroupEvent(eventService.checkGroup(), account.getName(), null , GroupType.LECTURE, Visibility.PUBLIC),
Collections.addAll(eventList, new CreateGroupEvent(eventService.checkGroup(), account.getName(), null , GroupType.LECTURE, visibility1),
new AddUserEvent(eventService.checkGroup(), account.getName(),account.getGivenname(),account.getFamilyname(),account.getEmail()),
new UpdateRoleEvent(eventService.checkGroup(), account.getName(), Role.ADMIN),
new UpdateGroupTitleEvent(eventService.checkGroup(), account.getName(), title),