Hi Stan

Sorry the late answer - still mainly offline this week but will get back to
your question next week.

Cheers,
Thomas


On Sun, Aug 10, 2014 at 1:13 AM, Stan Ioan Eugen <[email protected]> wrote:

> Hello,
>
> I'm working on a web service which uses deltaspike data and cxf to
> expose a jax-rs service. My service needs to show data based on the
> current user and I would like to hear your opinion on what is the best
> approach to do this with deltaspike data.
>
> I have my repository defined like this:
>
> @Repository
> @Transactional
> public interface InvoiceRepository extends EntityRepository<Invoice, ID> {
> }
>
> I wish that when user A calls the service, my repository should list
> only invoices that  he owns. The Invoice entity has a owner field
> (links to the account, and to the user)
>
> What is the best approach that I should use? I'm using Shiro for
> security. My idea so far is to make a custom EntityRepository
> implementation that will get the current user and filer (don't know
> exactly how yet) by it.
>
> I've searched for a solution to Spring Data [1], but it seems they
> haven't implemented it yet. Are there plans for Deltaspike Data to
> support such a feature?
>
> Regards,
>
> [1] https://jira.spring.io/browse/DATACMNS-293
>
>
> --
> Ioan Eugen Stan / ieugen.ro
>

Reply via email to