Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-3575

Misguiding find method in ResourcePolicyService

    Details

    • Attachments:
      0
    • Comments:
      2
    • Documentation Status:
      Not Required

      Description

      ResourcePolicyService.find(Context c, DSpaceObject dso, Group group, int action, int notPolicyID) contains the attribute nonPolicyID. The method looks for resource policies that allow the specified group the specified action on the specified DSpaceObject but have another policy ID than the specified one. This is used to check for duplicated resource policies.
      While the intention of the method is good, it is error prone to have an attribute that is only marked by its name to look for everything but the specified attribute. Correspondingly it was misused by AuthorizeService.findByTypeIdGroupAction(...). To prevent bugs like this, I renamed the method to ResourcePolicyService.findByTypeGroupActionExceptId(...).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              pbecker Pascal-Nicolas Becker
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: