View Javadoc

1   package org.itracker.persistence.dao;
2   
3   import java.util.List;
4   
5   import org.itracker.model.Permission;
6   
7   /**
8    * 
9    */
10  public interface PermissionDAO extends BaseDAO<Permission> {
11  
12      /**
13       * Finds all Permissions granted to a user. 
14       * 
15       * @param userId 
16       * @return list of permissions granted to the given user, in unspecified order
17       */
18      List<Permission> findByUserId(Integer userId);
19      
20      /**
21       * Finds all Permissions of a given type granted on a project. 
22       * 
23       * @param projectId only permissions on this project will be returned
24       * @param permissionType type of permissions to return 
25       * @return list of permissions, in unspecified order
26       */
27      List<Permission> findByProjectIdAndPermission(Integer projectId, 
28              int permissionType);
29  
30  }