svn commit: r757068 - in /ofbiz/trunk/framework/security/src/org/ofbiz/security: OFBizSecurity.java Security.java SecurityConfigurationException.java SecurityFactory.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r757068 - in /ofbiz/trunk/framework/security/src/org/ofbiz/security: OFBizSecurity.java Security.java SecurityConfigurationException.java SecurityFactory.java

doogie-3
Author: doogie
Date: Sat Mar 21 23:23:02 2009
New Revision: 757068

URL: http://svn.apache.org/viewvc?rev=757068&view=rev
Log:
Fix purely empty whitespace lines, and remove trailing whitespace.

Modified:
    ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java
    ofbiz/trunk/framework/security/src/org/ofbiz/security/Security.java
    ofbiz/trunk/framework/security/src/org/ofbiz/security/SecurityConfigurationException.java
    ofbiz/trunk/framework/security/src/org/ofbiz/security/SecurityFactory.java

Modified: ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java?rev=757068&r1=757067&r2=757068&view=diff
==============================================================================
--- ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java (original)
+++ ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java Sat Mar 21 23:23:02 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -44,13 +44,13 @@
  * OFBizSecurity.
  */
 public class OFBizSecurity extends org.ofbiz.security.Security {
-    
+
     public static final String module = OFBizSecurity.class.getName();
-    
+
     public static final Map<String, Map<String, String>> simpleRoleEntity = UtilMisc.toMap(
         "ORDERMGR", UtilMisc.toMap("name", "OrderRole", "pkey", "orderId"),
         "FACILITY", UtilMisc.toMap("name", "FacilityParty", "pkey", "facilityId"),
-        "MARKETING", UtilMisc.toMap("name", "MarketingCampaignRole", "pkey", "marketingCampaignId"));    
+        "MARKETING", UtilMisc.toMap("name", "MarketingCampaignRole", "pkey", "marketingCampaignId"));
 
     GenericDelegator delegator = null;
 
@@ -70,7 +70,7 @@
 
     /**
      * @see org.ofbiz.security.Security#findUserLoginSecurityGroupByUserLoginId(java.lang.String)
-     */  
+     */
     public Iterator<GenericValue> findUserLoginSecurityGroupByUserLoginId(String userLoginId) {
         List<GenericValue> collection = userLoginSecurityGroupByUserLoginId.get(userLoginId);
 
@@ -91,7 +91,7 @@
 
     /**
      * @see org.ofbiz.security.Security#securityGroupPermissionExists(java.lang.String, java.lang.String)
-     */  
+     */
     public boolean securityGroupPermissionExists(String groupId, String permission) {
         GenericValue securityGroupPermissionValue = delegator.makeValue("SecurityGroupPermission",
                 UtilMisc.toMap("groupId", groupId, "permissionId", permission));
@@ -115,7 +115,7 @@
 
     /**
      * @see org.ofbiz.security.Security#hasPermission(java.lang.String, javax.servlet.http.HttpSession)
-     */    
+     */
     public boolean hasPermission(String permission, HttpSession session) {
         GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");
 
@@ -126,7 +126,7 @@
 
     /**
      * @see org.ofbiz.security.Security#hasPermission(java.lang.String, org.ofbiz.entity.GenericValue)
-     */    
+     */
     public boolean hasPermission(String permission, GenericValue userLogin) {
         if (userLogin == null) return false;
 
@@ -143,7 +143,7 @@
 
     /**
      * @see org.ofbiz.security.Security#hasEntityPermission(java.lang.String, java.lang.String, javax.servlet.http.HttpSession)
-     */    
+     */
     public boolean hasEntityPermission(String entity, String action, HttpSession session) {
         GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");
 
@@ -153,7 +153,7 @@
 
     /**
      * @see org.ofbiz.security.Security#hasEntityPermission(java.lang.String, java.lang.String, org.ofbiz.entity.GenericValue)
-     */  
+     */
     public boolean hasEntityPermission(String entity, String action, GenericValue userLogin) {
         if (userLogin == null) return false;
 
@@ -175,7 +175,7 @@
 
         return false;
     }
-    
+
     /**
      * @see org.ofbiz.security.Security#hasRolePermission(java.lang.String, java.lang.String, java.lang.String, java.lang.String, javax.servlet.http.HttpSession)
      */
@@ -183,7 +183,7 @@
         GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");
         return hasRolePermission(application, action, primaryKey, role, userLogin);
     }
-    
+
     /**
      * @see org.ofbiz.security.Security#hasRolePermission(java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.ofbiz.entity.GenericValue)
      */
@@ -192,32 +192,32 @@
         if (role != null && !role.equals(""))
             roles = UtilMisc.toList(role);
         return hasRolePermission(application, action, primaryKey, roles, userLogin);
-    }    
-                
+    }
+
     /**
      * @see org.ofbiz.security.Security#hasRolePermission(java.lang.String, java.lang.String, java.lang.String, java.util.List, javax.servlet.http.HttpSession)
      */
     public boolean hasRolePermission(String application, String action, String primaryKey, List<String> roles, HttpSession session) {
         GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");
         return hasRolePermission(application, action, primaryKey, roles, userLogin);
-    }    
-    
+    }
+
     /**
      * @see org.ofbiz.security.Security#hasRolePermission(java.lang.String, java.lang.String, java.lang.String, java.util.List, org.ofbiz.entity.GenericValue)
      */
     public boolean hasRolePermission(String application, String action, String primaryKey, List<String> roles, GenericValue userLogin) {
         String entityName = null;
         EntityCondition condition = null;
-        
+
         if (userLogin == null)
             return false;
-            
-        // quick test for special cases where were just want to check the permission (find screens)              
+
+        // quick test for special cases where were just want to check the permission (find screens)
         if (primaryKey.equals("") && roles == null) {
             if (hasEntityPermission(application, action, userLogin)) return true;
             if (hasEntityPermission(application + "_ROLE", action, userLogin)) return true;
-        }            
-        
+        }
+
         Map<String, String> simpleRoleMap = OFBizSecurity.simpleRoleEntity.get(application);
         if (simpleRoleMap != null && roles != null) {
             entityName = simpleRoleMap.get("name");
@@ -225,19 +225,19 @@
             if (pkey != null) {
                 List<EntityExpr> expressions = new ArrayList<EntityExpr>();
                 for (String role: roles) {
-                    expressions.add(EntityCondition.makeCondition("roleTypeId", EntityOperator.EQUALS, role));                    
+                    expressions.add(EntityCondition.makeCondition("roleTypeId", EntityOperator.EQUALS, role));
                 }
                 EntityConditionList<EntityExpr> exprList = EntityCondition.makeCondition(expressions, EntityOperator.OR);
                 EntityExpr keyExpr = EntityCondition.makeCondition(pkey, primaryKey);
                 EntityExpr partyExpr = EntityCondition.makeCondition("partyId", userLogin.getString("partyId"));
                 condition = EntityCondition.makeCondition(exprList, keyExpr, partyExpr);
             }
-            
+
         }
-        
-        return hasRolePermission(application, action, entityName, condition, userLogin);                      
+
+        return hasRolePermission(application, action, entityName, condition, userLogin);
     }
-    
+
     /**
      * Like hasEntityPermission above, this checks the specified action, as well as for "_ADMIN" to allow for simplified
      * general administration permission, but also checks action_ROLE and validates the user is a member for the
@@ -252,13 +252,13 @@
      */
     public boolean hasRolePermission(String application, String action, String entityName, EntityCondition condition, GenericValue userLogin) {
         if (userLogin == null) return false;
-        
+
         // first check the standard permission
         if (hasEntityPermission(application, action, userLogin)) return true;
-        
+
         // make sure we have what's needed for role security
         if (entityName == null || condition == null) return false;
-        
+
         // now check the user for the role permission
         if (hasEntityPermission(application + "_ROLE", action, userLogin)) {
             // we have the permission now, we check to make sure we are allowed access
@@ -270,13 +270,13 @@
                 Debug.logError(e, "Problems doing role security lookup on entity [" + entityName + "] using [" + condition + "]", module);
                 return false;
             }
-            
+
             // if we pass all tests
             //Debug.logInfo("Found (" + (roleTest == null ? 0 : roleTest.size()) + ") matches :: " + roleTest, module);
             if (roleTest != null && roleTest.size() > 0) return true;
         }
-        
+
         return false;
     }
-            
+
 }

Modified: ofbiz/trunk/framework/security/src/org/ofbiz/security/Security.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/Security.java?rev=757068&r1=757067&r2=757068&view=diff
==============================================================================
--- ofbiz/trunk/framework/security/src/org/ofbiz/security/Security.java (original)
+++ ofbiz/trunk/framework/security/src/org/ofbiz/security/Security.java Sat Mar 21 23:23:02 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -114,7 +114,7 @@
      * @return Returns true if the currently logged in userLogin has the specified permission, otherwise returns false.
      */
     public abstract boolean hasEntityPermission(String entity, String action, GenericValue userLogin);
-    
+
     /**
      * Like hasEntityPermission above, this checks the specified action, as well as for "_ADMIN" to allow for simplified
      * general administration permission, but also checks action_ROLE and validates the user is a member for the
@@ -123,10 +123,10 @@
      * @param application The name of the application corresponding to the desired permission.
      * @param action The action on the application corresponding to the desired permission.
      * @param primaryKey The primary key for the role check.
-     * @param role The roleTypeId which the user must validate with.
+     * @param role The roleTypeId which the user must validate with.
      * @param session The current HTTP session, contains the logged in userLogin as an attribute.
      * @return Returns true if the currently logged in userLogin has the specified permission, otherwise returns false.
-     */    
+     */
     public abstract boolean hasRolePermission(String application, String action, String primaryKey, String role, HttpSession session);
 
     /**
@@ -142,7 +142,7 @@
      * @return Returns true if the currently logged in userLogin has the specified permission, otherwise returns false.
      */
     public abstract boolean hasRolePermission(String application, String action, String primaryKey, String role, GenericValue userLogin);
-        
+
     /**
      * Like hasEntityPermission above, this checks the specified action, as well as for "_ADMIN" to allow for simplified
      * general administration permission, but also checks action_ROLE and validates the user is a member for the
@@ -156,7 +156,7 @@
      * @return Returns true if the currently logged in userLogin has the specified permission, otherwise returns false.
      */
     public abstract boolean hasRolePermission(String application, String action, String primaryKey, List<String> roles, GenericValue userLogin);
-    
+
     /**
      * Like hasEntityPermission above, this checks the specified action, as well as for "_ADMIN" to allow for simplified
      * general administration permission, but also checks action_ROLE and validates the user is a member for the
@@ -165,10 +165,10 @@
      * @param application The name of the application corresponding to the desired permission.
      * @param action The action on the application corresponding to the desired permission.
      * @param primaryKey The primary key for the role check.
-     * @param roles List of roleTypeId of which the user must validate with (ORed).
+     * @param roles List of roleTypeId of which the user must validate with (ORed).
      * @param session The current HTTP session, contains the logged in userLogin as an attribute.
      * @return Returns true if the currently logged in userLogin has the specified permission, otherwise returns false.
-     */    
+     */
     public abstract boolean hasRolePermission(String application, String action, String primaryKey, List<String> roles, HttpSession session);
-    
+
 }

Modified: ofbiz/trunk/framework/security/src/org/ofbiz/security/SecurityConfigurationException.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/SecurityConfigurationException.java?rev=757068&r1=757067&r2=757068&view=diff
==============================================================================
--- ofbiz/trunk/framework/security/src/org/ofbiz/security/SecurityConfigurationException.java (original)
+++ ofbiz/trunk/framework/security/src/org/ofbiz/security/SecurityConfigurationException.java Sat Mar 21 23:23:02 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

Modified: ofbiz/trunk/framework/security/src/org/ofbiz/security/SecurityFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/SecurityFactory.java?rev=757068&r1=757067&r2=757068&view=diff
==============================================================================
--- ofbiz/trunk/framework/security/src/org/ofbiz/security/SecurityFactory.java (original)
+++ ofbiz/trunk/framework/security/src/org/ofbiz/security/SecurityFactory.java Sat Mar 21 23:23:02 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -35,10 +35,10 @@
  * If no customiz security name is given, the default implementation will be used (OFBizSecurity)
  */
 public class SecurityFactory {
-    
+
     public static final String module = SecurityFactory.class.getName();
     public static final String DEFAULT_SECURITY = "org.ofbiz.security.OFBizSecurity";
-    
+
     private static String securityName = null;
     private static Element rootElement = null;
     private static SecurityConfigUtil.SecurityInfo securityInfo = null;