Author: keith
Date: Mon Apr 28 09:27:31 2008
New Revision: 16286

Log:

Minor code cleanup


Modified:
   
trunk/mashup/java/modules/core/src/org/wso2/mashup/realm/wsas/WSASAuthorizer.java

Modified: 
trunk/mashup/java/modules/core/src/org/wso2/mashup/realm/wsas/WSASAuthorizer.java
==============================================================================
--- 
trunk/mashup/java/modules/core/src/org/wso2/mashup/realm/wsas/WSASAuthorizer.java
   (original)
+++ 
trunk/mashup/java/modules/core/src/org/wso2/mashup/realm/wsas/WSASAuthorizer.java
   Mon Apr 28 09:27:31 2008
@@ -53,11 +53,7 @@
             String action) throws UserStoreException {
 
         Boolean isAuthorized = getRoleAuthorized(roleName, resourceId, action);
-        if (isAuthorized == null) {
-            return false;
-        } else {
-            return isAuthorized.booleanValue();
-        }
+        return isAuthorized != null && isAuthorized.booleanValue();
     }
 
     public boolean isUserAuthorized(String userName, String resourceId,
@@ -71,11 +67,7 @@
                     resourceId, action);
         }
 
-        if (isAuthorized == null) {
-            return false;
-        } else {
-            return isAuthorized.booleanValue();
-        }
+        return isAuthorized != null && isAuthorized.booleanValue();
     }
 
     public String[] getAllowedUsersForResource(String resourceId, String 
action)
@@ -257,7 +249,7 @@
                 Boolean roleAuth = getRoleAuthorized(roleName, resourceId,
                         action);
                 if (roleAuth != null) {
-                    if (roleAuth.booleanValue() == false) {
+                    if (!roleAuth.booleanValue()) {
                         isAuthorized = roleAuth;
                         break;
                     } else {
@@ -267,8 +259,8 @@
             }
         }
 
-        if (isAuthorized == null && onceAllowed == true) {
-            isAuthorized = new Boolean(true);
+        if (isAuthorized == null && onceAllowed) {
+            isAuthorized = Boolean.TRUE;
         }
 
         return isAuthorized;

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to