package pl.dmcs.mati.service;

import org.springframework.security.access.annotation.Secured;
import org.springframework.security.access.prepost.PreAuthorize;
import pl.dmcs.mati.domain.AppUser;

import java.util.List;

public interface AppUserService {
    //@Secured("ROLE_ADMIN")
    void addAppUser (AppUser appUser);
    @PreAuthorize("hasRole('ROLE_ADMIN') OR (#appUser.login == principal.username)")
    void editAppUser (AppUser appUser);
    public List<AppUser> listAppUser();
    @Secured("ROLE_ADMIN")
    public void removeAppUser (long id);
    public AppUser getAppUser(long id);
    AppUser findByLogin(String login);
}
