Details

    • Type: Sub-task Sub-task
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Labels:
      None

      Description

      New annotation "@CurrentUser" should inject the current user into a data field (this is what databases do with the CURRENT USER constraint).

      As in the Java EE environment there is a difference between security principals, business layer people, and database accounts, there should be a mapping available. For example "@CurrentUser(type = PRINCIPAL_NAME) String createdBy" would default the content of "createdBy" to the name of the caller principal's name. This is the most common need for automatic values in business applications.

        Activity

        Hide
        arjan tijms added a comment -

        I wonder if something akin to @CurrentUser should not also, or perhaps first, be available for the entire Java EE platform.

        Show
        arjan tijms added a comment - I wonder if something akin to @CurrentUser should not also, or perhaps first, be available for the entire Java EE platform.
        Hide
        mkarg added a comment -

        Arjan, you can inject the current security principal into any CDI beand and EJB. So you have that there already. My proposal is focused on JPA because you cannot inject the security principal into a JPA entity.

        Show
        mkarg added a comment - Arjan, you can inject the current security principal into any CDI beand and EJB. So you have that there already. My proposal is focused on JPA because you cannot inject the security principal into a JPA entity.

          People

          • Assignee:
            ldemichiel
            Reporter:
            mkarg
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: