Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-38890

addMember should throw exception for null role rather than fail with warning

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.x
    • Fix Version/s: 2.8.x
    • Component/s: Kernel
    • Labels:
      None
    • Previous Issue Keys:
      SAK-8324, KNL-420

      Description

      addMember(String user, String roleId, boolean active, boolean provided) in BaseAuthzGroup.java contains this code:

      if (role == null)

      { M_log.warn(".addUserRole: role undefined: " + roleId); return; }

      This means that if addMember is called with a null role, it fails silently (as far as the calling tool/service is concerned), with only a warning message in the logs.

      It would be preferable for this function to throw an exception, which would expose the failed operation in the UI.

      We have some examples of these warning messages in our catalina.out logs, but the lack of an exception here means it is hard to identify where and why addMember() is being called with a null role.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  dhorwitz David Horwitz
                  Reporter:
                  smarquard Stephen Marquard
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code