package org.itevents.service;

import org.itevents.dao.Event;
import org.itevents.dao.User;


/**
 * Created by Well on 29.07.2015.
 */
public class GoToEventImpl implements GoToEvent {

    private boolean isLogged(User user){
        //  

        return false;
    }

    @Override
    public Long goToEvent(User user, Event event) {
       if (!isLogged(user)){
           System.out.println("Login to subscribe!");
       }




        return null;
    }
}


@@ -85,16 +85,81 @@
 o.User;%0A
+import org.springframework.security.access.prepost.PreAuthorize;%0A
 %0A%0A/**%0A *
@@ -253,101 +253,56 @@
     
-private boolean isLogged(User user)%7B%0A        //  %0A%0A        return false;%0A    %7D%0A%0A    @Override
+@Override%0A    @PreAuthorize(%22isAuthenticated()%22)
 %0A   
@@ -354,40 +354,9 @@
 ) %7B%0A
-       if (!isLogged(user))%7B%0A   
+%0A
     
@@ -406,19 +406,8 @@
 %22);%0A
-       %7D%0A%0A%0A
 %0A%0A  

add autorisation