Scarab commit: svn commit: r10214 - branches/release/b21/src/java/org/tigris/scarab: notification om

[email protected]
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: dabbous
Date: 2006-07-22 02:39:48-0700
New Revision: 10214

Modified:
   branches/release/b21/src/java/org/tigris/scarab/notification/ScarabNewNotificationManager.java
   branches/release/b21/src/java/org/tigris/scarab/om/IssueTemplateInfo.java

Log:
code cleanup (no functional modifications)

Modified: branches/release/b21/src/java/org/tigris/scarab/notification/ScarabNewNotificationManager.java
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/b21/src/java/org/tigris/scarab/notification/ScarabNewNotificationManager.java?view=diff&rev=10214&p1=branches/release/b21/src/java/org/tigris/scarab/notification/ScarabNewNotificationManager.java&p2=branches/release/b21/src/java/org/tigris/scarab/notification/ScarabNewNotificationManager.java&r1=10213&r2=10214
==============================================================================
--- branches/release/b21/src/java/org/tigris/scarab/notification/ScarabNewNotificationManager.java	(original)
+++ branches/release/b21/src/java/org/tigris/scarab/notification/ScarabNewNotificationManager.java	2006-07-22 02:39:48-0700
@@ -154,17 +154,10 @@
                     Issue actIssue = act.getIssue();
                     Set users = issue.getAllUsersToEmail(AttributePeer.EMAIL_TO);
                     users.addAll(actIssue.getAllUsersToEmail(AttributePeer.CC_TO));
-                    //users.addAll(getArchiveUsers(actIssue));
                     
                     // FIXME: Should we still make difference between CC & TO? If so...
                     // ...do we need this info in the notification_status table??
                     
-                    // FIXME: Should we call the ActivityFilter here to discover every user
-                    // interested in this issue, beyond those directly assigned to it?
-                    // Who would that be ? What algorythm shoul be used at all ?
-                    // The NotificationFiltering has no association to issues, so maybe
-                    // this fixme is obsolete now and can be removed? [HD,17-nov-2005]
-                    
                     // FIXME: SCB1439. does the user really have permissions
                     // to view this attribute?
                     

Modified: branches/release/b21/src/java/org/tigris/scarab/om/IssueTemplateInfo.java
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/b21/src/java/org/tigris/scarab/om/IssueTemplateInfo.java?view=diff&rev=10214&p1=branches/release/b21/src/java/org/tigris/scarab/om/IssueTemplateInfo.java&p2=branches/release/b21/src/java/org/tigris/scarab/om/IssueTemplateInfo.java&r1=10213&r2=10214
==============================================================================
--- branches/release/b21/src/java/org/tigris/scarab/om/IssueTemplateInfo.java	(original)
+++ branches/release/b21/src/java/org/tigris/scarab/om/IssueTemplateInfo.java	2006-07-22 02:39:48-0700
@@ -86,9 +86,10 @@
     {
         // can delete a template if they have delete permission
         // Or if is their personal template
-        return (user.hasPermission(ScarabSecurity.ITEM__DELETE, getIssue().getModule())
-            || (user.getUserId().equals(getIssue().getCreatedBy().getUserId()) 
-                && getScopeId().equals(Scope.PERSONAL__PK)));
+        boolean hasPermission    = user.hasPermission(ScarabSecurity.ITEM__DELETE, getIssue().getModule());
+        boolean isCreatedBySelf  = user.getUserId().equals(getIssue().getCreatedBy().getUserId());
+        boolean hasScopePersonal = getScopeId().equals(Scope.PERSONAL__PK);
+        return (hasPermission || (isCreatedBySelf && hasScopePersonal));
     }
 
     public boolean canEdit(ScarabUser user)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.