Uploaded image for project: 'Shiro'
  1. Shiro
  2. SHIRO-484

Variables in annotations

    XMLWordPrintableJSON

Details

    Description

      I'm sure that I'm not the first who want it, but not found request about that. Are there any plans for supporting variables in Shiro annotations? Instead of dynamic checking like that:

      public Project getProject(String id) {
      SecurityUtils.getSubject().checkPermissions("project:" + id + ":read");
      ...
      }

      it would be nice to have:

      @RequiresPermissions(

      {"project:#id:read"}

      )
      public Project getProject(String id) {
      ...
      }

      variable reference could be in other syntax (${id}, $id, [id]...) or for better backward compatibility variables should be marked by new annotation just like:

      @RequiresPermissions(

      {"project:#id:read"}

      )
      public Project getProject(@ShiroVariable("id") String id) {
      ...
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            mschayna Martin Schayna
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: