Interface PrivilegeRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Privilege,Long>, org.springframework.data.jpa.repository.JpaRepository<Privilege,Long>, org.springframework.data.repository.ListCrudRepository<Privilege,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<Privilege,Long>, org.springframework.data.repository.PagingAndSortingRepository<Privilege,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<Privilege>, org.springframework.data.repository.Repository<Privilege,Long>

public interface PrivilegeRepository extends org.springframework.data.jpa.repository.JpaRepository<Privilege,Long>
Repository class to represent the data access layer of the `privilege` entity.
Author:
Infosys Equinox
  • Method Details

    • findByServiceAndLevelLessThanEqual

      List<Privilege> findByServiceAndLevelLessThanEqual(String service, Long level)

      findByServiceAndLevelLessThanEqual.

      This method return the list of dynamic privileges.
      Parameters:
      service - a name of the service need from this query.
      level - a level of the dynamic privilege.
      Returns:
      a list of privileges.
    • findAllBusinessLevelRolePrivilegesByUserId

      @Query(value="select c.businessid as businessid, p.id as privilegeid, p.entity as entity, p.action as action, p.service as service from collection c, user_role u_r, role r, role_privilegeset r_ps, privilegeset_privilege ps_p, privilegeset ps, privilege p where c.id = ps.collectionid and r_ps.privilegesets_id = ps.id and r_ps.privilegesets_id = ps_p.privilegeset_id and ps_p.privileges_id = p.id and u_r.role_name = r.name and r.id = r_ps.role_id and u_r.user_id = ?1", nativeQuery=true) List<PrivilegeRepository.BusinessPrivilegesProjection> findAllBusinessLevelRolePrivilegesByUserId(Long userId)

      findAllBusinessLevelRolePrivilegesByUserId

      Parameters:
      userId - a Long object.
      Returns:
      a List object.
    • findAllBusinessLevelGroupPrivilegesByUserId

      @Query(value="select c.businessid as businessid, p.id as privilegeid, p.entity as entity, p.action as action, p.service as service from collection c, authgroup_userids ag_u, authgroup_role ag_r, role_privilegeset r_ps, privilegeset_privilege ps_p, privilegeset ps, privilege p where c.id = ps.collectionid and r_ps.privilegesets_id = ps.id and r_ps.privilegesets_id = ps_p.privilegeset_id and ps_p.privileges_id = p.id and ag_r.roles_id = r_ps.role_id and ag_u.authgroup_id = ag_r.authgroup_id and ag_u.userids = ?1", nativeQuery=true) List<PrivilegeRepository.BusinessPrivilegesProjection> findAllBusinessLevelGroupPrivilegesByUserId(Long userId)

      findAllBusinessLevelGroupPrivilegesByUserId

      Parameters:
      userId - a Long object.
      Returns:
      a List object.
    • findAllDynamicRolePrivilegesByUserId

      @Query(value="select c.businessid as businessid, p.id as privilegeid, p.entity as entity, p.action as action, p.service as service from collection c, user_role r_u, role_privilegeset r_ps, privilegeset ps, dynamic_privilege dy_p, privilege p where c.id = ps.collectionid and r_ps.privilegesets_id = ps.id and r_ps.privilegesets_id = dy_p.privilegesetid and dy_p.level <= p.level and dy_p.service = p.service and r_u.role_id = r_ps.role_id and r_u.userids = ?1", nativeQuery=true) List<PrivilegeRepository.BusinessPrivilegesProjection> findAllDynamicRolePrivilegesByUserId(Long userId)

      findAllDynamicRolePrivilegesByUserId

      Parameters:
      userId - a Long object.
      Returns:
      a List object.
    • findAllDynamicGroupPrivilegesByUserId

      @Query(value="select c.businessid as businessid, p.id as privilegeid, p.entity as entity, p.action as action, p.service as service from collection c, user_role r_u, role_privilegeset r_ps, privilegeset ps, dynamic_privilege dy_p, authgroup_role ag_r, authgroup_userids ag_u, privilege p where c.id = ps.collectionid and r_ps.privilegesets_id = ps.id and r_ps.privilegesets_id = dy_p.privilegesetid and dy_p.level <= p.level and dy_p.service = p.service and ag_r.roles_id = r_ps.role_id and ag_r.authgroup_id = ag_u.authgroup_id and ag_u.userids = ?1", nativeQuery=true) List<PrivilegeRepository.BusinessPrivilegesProjection> findAllDynamicGroupPrivilegesByUserId(Long userId)

      findAllDynamicGroupPrivilegesByUserId

      Parameters:
      userId - a Long object.
      Returns:
      a List object.
    • findAllCollectionLevelRolePrivilegesByUserId

      @Query(value="select c.businessid as businessid, p.id as privilegeid, p.entity as entity, p.action as action, p.service as service, p_c_m.collectionid as collectionid from collection c, user_role r_u, role_privilegeset r_ps, privilegeset_privilege ps_p, privilegeset ps, privilege p, privilege_collection_map p_c_m where c.id = ps.collectionid and r_ps.privilegesets_id = ps.id and r_ps.privilegesets_id = ps_p.privilegeset_id and ps_p.privileges_id = p.id and ps_p.privilegeset_id = p_c_m.privilegesetid and p_c_m.privilegeid = p.id and r_u.role_id = r_ps.role_id and r_u.userids = ?1", nativeQuery=true) List<PrivilegeRepository.CollectionLevelPrivilegesProjection> findAllCollectionLevelRolePrivilegesByUserId(Long userId)

      findAllCollectionLevelRolePrivilegesByUserId

      Parameters:
      userId - a Long object.
      Returns:
      a List object.
    • findAllCollectionLevelGroupPrivilegesByUserId

      @Query(value="select c.businessid as businessid, p.id as privilegeid, p.entity as entity, p.action as action, p.service as service, p_c_m.collectionid as collectionid from collection c, user_role r_u, role_privilegeset r_ps, privilegeset_privilege ps_p, privilegeset ps, privilege p, privilege_collection_map p_c_m, authgroup_role ag_r, authgroup_userids ag_u where c.id = ps.collectionid and r_ps.privilegesets_id = ps.id and r_ps.privilegesets_id = ps_p.privilegeset_id and ps_p.privileges_id = p.id and ps_p.privilegeset_id = p_c_m.privilegesetid and p_c_m.privilegeid = p.id and ag_r.roles_id = r_ps.role_id and ag_r.authgroup_id = ag_u.authgroup_id and ag_u.userids = ?1", nativeQuery=true) List<PrivilegeRepository.CollectionLevelPrivilegesProjection> findAllCollectionLevelGroupPrivilegesByUserId(Long userId)

      findAllCollectionLevelGroupPrivilegesByUserId

      Parameters:
      userId - a Long object.
      Returns:
      a List object.
    • findByServiceAndActionAndEntity

      Optional<Privilege> findByServiceAndActionAndEntity(String service, String action, String entity)