You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by wo...@apache.org on 2008/09/08 14:59:52 UTC
svn commit: r693084 - in
/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed:
profiler/impl/JetspeedProfilerImpl.java
serializer/JetspeedProfilerSerializer.java
Author: woonsan
Date: Mon Sep 8 05:59:51 2008
New Revision: 693084
URL: http://svn.apache.org/viewvc?rev=693084&view=rev
Log:
Flattening the Principal API.
Uses transient inlined principal and fixed unnecessary getting principal from user.
Modified:
portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/impl/JetspeedProfilerImpl.java
portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/serializer/JetspeedProfilerSerializer.java
Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/impl/JetspeedProfilerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/impl/JetspeedProfilerImpl.java?rev=693084&r1=693083&r2=693084&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/impl/JetspeedProfilerImpl.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/impl/JetspeedProfilerImpl.java Mon Sep 8 05:59:51 2008
@@ -66,11 +66,12 @@
/**
* This is the principal that is used if there are no principal to rule associations for the current principal
*/
- public final static Principal DEFAULT_RULE_PRINCIPAL = new UserImpl();
- static
- {
- ((UserImpl) DEFAULT_RULE_PRINCIPAL).setName("*");
- }
+ public final static Principal DEFAULT_RULE_PRINCIPAL = new Principal() {
+ public String getName()
+ {
+ return "*";
+ }
+ };
/** The default locator class implementation */
private String locatorBean = "ProfileLocator";
Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/serializer/JetspeedProfilerSerializer.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/serializer/JetspeedProfilerSerializer.java?rev=693084&r1=693083&r2=693084&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/serializer/JetspeedProfilerSerializer.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/serializer/JetspeedProfilerSerializer.java Mon Sep 8 05:59:51 2008
@@ -88,15 +88,11 @@
String anonymousUser = userManager.getAnonymousUser();
for (User _user : userManager.getUsers(""))
{
- Principal principal = SecurityHelper.getPrincipal(userManager.getSubject(_user), User.class);
- if (principal != null)
+ Collection col = pm.getRulesForPrincipal(_user);
+ Iterator _itCol = col.iterator();
+ while (_itCol.hasNext())
{
- Collection col = pm.getRulesForPrincipal(principal);
- Iterator _itCol = col.iterator();
- while (_itCol.hasNext())
- {
- pm.deletePrincipalRule((PrincipalRule)_itCol.next());
- }
+ pm.deletePrincipalRule((PrincipalRule)_itCol.next());
}
}
Iterator _itRules = pm.getRules().iterator();
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org