[jboss-cvs] jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace ...

Shane Bryzak Shane_Bryzak at symantec.com
Sat Jan 27 09:25:31 EST 2007


  User: sbryzak2
  Date: 07/01/27 09:25:31

  Modified:    examples/seamspace/src/org/jboss/seam/example/seamspace  
                        Authenticator.java FriendAction.java
  Log:
  minor stuff
  
  Revision  Changes    Path
  1.4       +0 -1      jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace/Authenticator.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Authenticator.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace/Authenticator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- Authenticator.java	27 Jan 2007 14:05:53 -0000	1.3
  +++ Authenticator.java	27 Jan 2007 14:25:31 -0000	1.4
  @@ -12,7 +12,6 @@
   import org.jboss.seam.annotations.Out;
   import org.jboss.seam.annotations.Synchronized;
   import org.jboss.seam.core.FacesMessages;
  -import org.jboss.seam.security.Identity;
   
   /**
    * Authenticator bean - authenticates the user against the database
  
  
  
  1.2       +14 -6     jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace/FriendAction.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: FriendAction.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace/FriendAction.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- FriendAction.java	27 Jan 2007 14:05:53 -0000	1.1
  +++ FriendAction.java	27 Jan 2007 14:25:31 -0000	1.2
  @@ -16,6 +16,7 @@
   import org.jboss.seam.annotations.Out;
   import org.jboss.seam.annotations.RequestParameter;
   import org.jboss.seam.core.FacesMessages;
  +import org.jboss.seam.security.Identity;
   
   @Stateful
   @Name("friend")
  @@ -27,7 +28,7 @@
      @Out(required = false)
      private FriendComment friendComment;
      
  -   @In
  +   @In(required = false)
      private Member authenticatedMember;
      
      @In(create = true)
  @@ -43,10 +44,17 @@
            .setParameter("memberName", name)
            .getSingleResult(); 
   
  +         if (!Identity.instance().hasPermission("friendComment", "create", member.getFriends()))
  +         {
  +            FacesMessages.instance().add("You cannot leave a comment for this member");
  +         }
  +         else
  +         {
            friendComment = new FriendComment();
            friendComment.setFriend(authenticatedMember);
            friendComment.setMember(member);         
         }
  +      }
         catch (NoResultException ex) 
         { 
            FacesMessages.instance().add("Member not found.");
  
  
  



More information about the jboss-cvs-commits mailing list