ca6000a9f59f10d7712a29527728c489f85e0b96
[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 org.opendaylight.controller.sal.authorization.UserLevel;
13 import org.springframework.security.core.GrantedAuthority;
14
15 public class ODLUserLevel implements GrantedAuthority {
16         private static final long serialVersionUID = 1L;
17         UserLevel userLevel;
18
19     public ODLUserLevel(UserLevel userLevel) {
20         this.userLevel = userLevel;
21     }
22
23     @Override
24     public String getAuthority() {
25         return "ROLE_" + this.userLevel.toString().toUpperCase();
26     }
27
28 }