1 package de.fhdw.wtf.persistence.facade;
2
3 import java.util.Set;
4
5 import de.fhdw.wtf.persistence.exception.PersistenceException;
6 import de.fhdw.wtf.persistence.meta.Mandant;
7 import de.fhdw.wtf.persistence.meta.Role;
8 import de.fhdw.wtf.persistence.meta.User;
9
10 public interface AuthorizationFacade {
11
12 Mandant createMandant(String id, String rootPassword) throws PersistenceException;
13
14 void logIn(Mandant mandant) throws PersistenceException;
15
16 boolean isPasswordCorrect(String mandant, String username, String password) throws PersistenceException;
17
18 User createUser(String username, String password) throws PersistenceException;
19
20 void grantRoleToUser(User user, Role role) throws PersistenceException;
21
22 Role createRole(String name) throws PersistenceException;
23
24 Set<Role> getRolesFrom(User user) throws PersistenceException;
25
26 Set<User> getUsers() throws PersistenceException;
27
28 User getUser(String mandant, String name) throws PersistenceException;
29
30 Set<Role> listAllRoles() throws PersistenceException;
31
32 }