X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnorthbound%2Fcommons%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnorthbound%2Fcommons%2Futils%2FNorthboundUtils.java;h=7069ff041f6d5c8d1c7b33ca0f735287315d1f07;hp=3fedd0c9f8ea9d4fe8d5a470ca603e3298776f0a;hb=refs%2Fchanges%2F49%2F449%2F1;hpb=541d0a36997f292bb037a2199463431eee538358 diff --git a/opendaylight/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/utils/NorthboundUtils.java b/opendaylight/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/utils/NorthboundUtils.java index 3fedd0c9f8..7069ff041f 100644 --- a/opendaylight/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/utils/NorthboundUtils.java +++ b/opendaylight/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/utils/NorthboundUtils.java @@ -9,11 +9,11 @@ import org.opendaylight.controller.usermanager.IUserManager; public class NorthboundUtils { - + /** * Returns whether the current user has the required privilege on the * specified container - * + * * @param userName * The user name * @param containerName @@ -21,21 +21,21 @@ public class NorthboundUtils { * @param required * Operation to be performed - READ/WRITE * @param bundle - * Class from where the function is invoked + * Class from where the function is invoked * @return The Status of the request, either Success or Unauthorized */ public static boolean isAuthorized(String userName, String containerName, Privilege required,Object bundle) { - + if (containerName.equals(GlobalConstants.DEFAULT.toString())) { IUserManager auth = (IUserManager) ServiceHelper.getGlobalInstance( IUserManager.class, bundle); - + switch (required) { case WRITE: return (auth.getUserLevel(userName).ordinal() <= UserLevel.NETWORKADMIN.ordinal()); case READ: - return (auth.getUserLevel(userName).ordinal() <= UserLevel.NETWORKOPERATOR.ordinal()); + return (auth.getUserLevel(userName).ordinal() <= UserLevel.NETWORKOPERATOR.ordinal()); default: return false; } @@ -56,5 +56,5 @@ public class NorthboundUtils { } return true; } - + }