View Javadoc
1   package org.itracker.persistence.dao;
2   
3   import org.itracker.model.Permission;
4   import org.itracker.model.PermissionType;
5   
6   import java.util.List;
7   
8   /**
9    *
10   */
11  public interface PermissionDAO extends BaseDAO<Permission> {
12  
13      /**
14       * Finds all Permissions granted to a user.
15       *
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  
28      List<Permission> findByProjectIdAndPermission(Integer projectId,
29                                                    PermissionType permissionType);
30      @Deprecated
31      List<Permission> findByProjectIdAndPermission(Integer projectId,
32                                                    int permissionType);
33  
34  }