All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.marketcetera.admin.dao.PersistentPermissionDao Maven / Gradle / Ivy

The newest version!
package org.marketcetera.admin.dao;

import java.util.Set;

import org.marketcetera.admin.Permission;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;

/* $License$ */

/**
 * Provides datastore access to {@link Permission} objects.
 *
 * @author Colin DuPlantis
 * @version $Id$
 * @since 1.0.1
 */
public interface PersistentPermissionDao
        extends JpaRepository,QuerydslPredicateExecutor
{
    /**
     * Finds the permission with the given name.
     *
     * @param inName a String value
     * @return a PersistentPermission value or null
     */
    PersistentPermission findByName(String inName);
    /**
     * Gets the permissions granted to the user with the given username.
     *
     * @param inUsername a String value
     * @return a Set<PersistentPermission> value
     */
    @Query("select p from Permission p, IN(p.roles) r, IN(r.subjects) u where u.name = ?1")
    Set findAllByUsername(String inUsername);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy