Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-12960

UserRoleActorFactory is not null-safe causing weird behaviour at some point, e.g. comment box in view issue screen

    XMLWordPrintable

Details

    Description

      A scenario which we discovered from a user's support request:

      1. Enable anonymous comment (Add "Anyone" to "Add Comment" and "Browse Project" permission)
      2. Ensure that users are added into the "Administrators" role in the project role mapping, e.g. Users: Foo, Bar; Groups: jira-administrators
      3. View issue without logging into JIRA and you will notice two things:
        1. NPE thrown and logged in the log file:
          2007-06-22 18:33:12,937 http-8090-Processor4 ERROR [webwork.util.ServletValueStack] METHOD: "createHtml", exception: 
          java.lang.NullPointerException
          	at com.atlassian.jira.security.roles.actor.UserRoleActorFactory$UserRoleActor.contains(UserRoleActorFactory.java:114)
          	at com.atlassian.jira.security.roles.CachingProjectRoleAndActorStore$CachedDefaultRoleActors.contains(CachingProjectRoleAndActorStore.java:465)
          	at com.atlassian.jira.security.roles.DefaultProjectRoleManager.getProjectRoles(DefaultProjectRoleManager.java:37)
          	at com.atlassian.jira.issue.fields.CommentSystemField.getRoleLevels(CommentSystemField.java:515)
          	at com.atlassian.jira.issue.fields.CommentSystemField.populateVelocityParams(CommentSystemField.java:407)
          	at com.atlassian.jira.issue.fields.CommentSystemField.getCreateHtml(CommentSystemField.java:108)
          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          
        2. Comment fields disappeared (although the "Add Comment" container is visible)

      This happens because both UserRoleActorFactory and GroupRoleActorFactory are added to the CachedDefaultRoleActors as its construction level.

      Attachments

        Activity

          People

            jed Jed Wesley-Smith (Inactive)
            ekua Eddie Kua [Atlassian]
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: