User Manager to hash users passwords
[controller.git] / opendaylight / usermanager / api / src / main / java / org / opendaylight / controller / usermanager / ODLUserLevel.java
1
2 /*
3  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7  * and is available at http://www.eclipse.org/legal/epl-v10.html
8  */
9
10 package org.opendaylight.controller.usermanager;
11
12 import java.util.Locale;
13
14 import org.opendaylight.controller.sal.authorization.UserLevel;
15 import org.springframework.security.core.GrantedAuthority;
16
17 public class ODLUserLevel implements GrantedAuthority {
18         private static final long serialVersionUID = 1L;
19         UserLevel userLevel;
20
21     public ODLUserLevel(UserLevel userLevel) {
22         this.userLevel = userLevel;
23     }
24
25     @Override
26     public String getAuthority() {
27         return "ROLE_" + this.userLevel.toString().toUpperCase(Locale.ENGLISH);
28     }
29
30 }