Project

General

Profile

1
package eu.dnetlib.repo.manager.utils;
2

    
3
import org.springframework.stereotype.Component;
4

    
5
@Component("AuthorizationService")
6
public class AuthorizationService {
7

    
8
    public final String ROLE_ADMIN = "ROLE_ADMIN";
9
    public final String ROLE_PROVIDE_ADMIN = "ROLE_PROVIDE_ADMIN";
10
    public final String ROLE_USER = "ROLE_USER";
11

    
12
    private String mapType(String type) {
13
        if(type.equals("datasource")) {
14
            type = "datasource";
15
        }
16
        return type;
17
    }
18

    
19
    /**
20
     * Type = DATASOURCE
21
     *
22
     * */
23
    public String member(String type, String id) {
24
        return mapType(type).toUpperCase() + "_" + id.toUpperCase();
25
    }
26

    
27
}
(1-1/7)