Revision 61363
Added by Konstantinos Spyrou over 2 years ago
AuthorizationService.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.repo.manager.service.security; |
2 | 2 |
|
3 |
import eu.dnetlib.repo.manager.domain.dto.User; |
|
4 |
import eu.dnetlib.repo.manager.exception.ResourceNotFoundException; |
|
5 |
|
|
6 |
import java.util.List; |
|
7 |
|
|
3 | 8 |
public interface AuthorizationService { |
4 | 9 |
|
5 | 10 |
/** |
6 |
* |
|
7 | 11 |
* @param type |
8 | 12 |
* @param id |
9 | 13 |
* @return |
10 | 14 |
*/ |
11 |
String member(String type, String id); |
|
15 |
String member(String type, String id); //TODO: use or delete |
|
16 |
|
|
17 |
/** |
|
18 |
* @param id Resource Id to check. |
|
19 |
* @return Checks if a user is a member of a resource. |
|
20 |
*/ |
|
21 |
boolean isMemberOf(String id); |
|
22 |
|
|
23 |
|
|
24 |
/** |
|
25 |
* Returns a list of admins of the resource. |
|
26 |
* |
|
27 |
* @param repoId |
|
28 |
* @return |
|
29 |
*/ |
|
30 |
List<User> getAdminsOfRepo(String repoId); |
|
31 |
|
|
32 |
/** |
|
33 |
* Add a user as admin to a resource. |
|
34 |
* |
|
35 |
* @param id Resource id |
|
36 |
* @param email User email |
|
37 |
* @return |
|
38 |
* @throws ResourceNotFoundException |
|
39 |
*/ |
|
40 |
boolean addAdmin(String id, String email) throws ResourceNotFoundException; |
|
41 |
|
|
42 |
/** |
|
43 |
* Remove user from resource admins. |
|
44 |
* |
|
45 |
* @param id Resource id |
|
46 |
* @param email User email |
|
47 |
* @return |
|
48 |
* @throws ResourceNotFoundException |
|
49 |
*/ |
|
50 |
boolean removeAdmin(String id, String email) throws ResourceNotFoundException; |
|
12 | 51 |
} |
Also available in: Unified diff
1. refactoring and changes of rest api