X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fsal%2Fapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fauthorization%2FAppRoleLevel.java;fp=opendaylight%2Fsal%2Fapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fauthorization%2FAppRoleLevel.java;h=aa6514cd74e2f0ed8d338fb49e3d62c74c3b9286;hb=42210c03b0a4c54706320ba9f55794c0abd4d201;hp=0000000000000000000000000000000000000000;hpb=7576b38152b393793b1c9ec3df0ff86685f95236;p=controller.git diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/authorization/AppRoleLevel.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/authorization/AppRoleLevel.java new file mode 100644 index 0000000000..aa6514cd74 --- /dev/null +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/authorization/AppRoleLevel.java @@ -0,0 +1,46 @@ + +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +package org.opendaylight.controller.sal.authorization; + +import java.io.Serializable; + +/** + * Represents the application user role levels + * This level has meaning only inside the application context + * In the controller space such a role will be seen as APPUSER + * as specified in {@link UserLevel} + */ +public enum AppRoleLevel implements Serializable { + APPADMIN(0, "App-Admin", "Application Administrator"), APPUSER(1, + "App-User", "Application User"), APPOPERATOR(2, "Network-Operator", + "Application Operator"), NOUSER(255, "Unknown User", "Unknown User"); + + private int userLevel; + private String level; + private String prettyLevel; + + private AppRoleLevel(int userlevel, String level, String prettyLevel) { + this.userLevel = userlevel; + this.level = level; + this.prettyLevel = prettyLevel; + } + + public int toNumber() { + return this.userLevel; + } + + public String toString() { + return this.level; + } + + public String toStringPretty() { + return this.prettyLevel; + } +}