-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@CurrentUser #48
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented Background: |
@glassfishrobot Commented |
@glassfishrobot Commented
There would also be an interface that is implemented (and registered with the JPA provider / EntityManagerFactory). For me this looks like:
|
@glassfishrobot Commented |
@glassfishrobot Commented |
@andyjefferson Commented |
|
Nailing down the semantics of this thing seems like an almost impossible task. You have:
Which of those things are we talking about here? How is there any hope of reaching agreement on that? I would say this doesn't belong in the spec. |
I agree this doesn't belong in the current proposal in the Persistence spec. "@Inject Principal" for the EE Security layer is defined for all CDI beans, and if this one if needed something like a service or Entity listener classes can be injected with that and set it in the JPA entity. |
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.
The text was updated successfully, but these errors were encountered: