1
|
/**
|
2
|
* Copyright (C) 2018 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.api.application;
|
10
|
|
11
|
import org.springframework.security.authentication.AuthenticationProvider;
|
12
|
import org.springframework.security.core.GrantedAuthority;
|
13
|
|
14
|
import eu.etaxonomy.cdm.persistence.permission.Role;
|
15
|
|
16
|
/**
|
17
|
* @author a.kohlbecker
|
18
|
* @since Oct 10, 2018
|
19
|
*
|
20
|
*/
|
21
|
public class RunAsAdmin extends AbstractRunAs {
|
22
|
|
23
|
/**
|
24
|
* @param authProvider
|
25
|
*/
|
26
|
public RunAsAdmin(AuthenticationProvider authProvider) {
|
27
|
setRunAsAuthenticationProvider(authProvider);
|
28
|
}
|
29
|
|
30
|
@Override
|
31
|
public GrantedAuthority runAsGrantedAuthority() {
|
32
|
return Role.ROLE_ADMIN;
|
33
|
}
|
34
|
|
35
|
}
|