Uploaded image for project: 'Red Hat Developer Hub Bugs'
  1. Red Hat Developer Hub Bugs
  2. RHDHBUGS-1784

Add a common error for Unauthorized actions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • None
    • RBAC Plugin
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • Release Note Not Required

      Description of problem:

      Plugin authors need to continously repeat throwing a NotAllowedError("Unauthorized"). Instead of repeating that code the common rbac can expose an Unauthorized error class.

      Steps to Reproduce

      with current code:
      if (decision.result == Deny) {

         throw NotAllowedError("Unauthorized")

      }

      Expected usage:

      throw new UnauthorizedError();

       

              rgolan1@redhat.com Roy Golan
              rgolan1@redhat.com Roy Golan
              RHIDP - Plugins
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: