make sure the user owns the modified data

This commit is contained in:
Athou
2013-04-10 22:07:44 +02:00
parent b3edfb955f
commit 013922b96d
4 changed files with 34 additions and 5 deletions

View File

@@ -100,6 +100,16 @@ public class FeedSubscriptionService extends GenericDAO<FeedSubscription> {
return criteria.getResultList();
}
public List<FeedSubscription> findByCategory(User user,
FeedCategory category) {
EasyCriteria<FeedSubscription> criteria = EasyCriteriaFactory
.createQueryCriteria(em, getType());
criteria.andEquals(MF.i(proxy().getUser()), user);
criteria.andEquals(MF.i(proxy().getCategory()), category);
return criteria.getResultList();
}
public List<FeedSubscription> findWithoutCategories(User user) {
EasyCriteria<FeedSubscription> criteria = EasyCriteriaFactory
.createQueryCriteria(em, getType());