1
0
forked from PGL/Clyde

added security to assistant posting and Get courses/owned for owners

This commit is contained in:
2024-03-17 12:13:03 +01:00
parent f7df234312
commit cf2deb983d
7 changed files with 77 additions and 20 deletions

View File

@ -1,8 +1,15 @@
package ovh.herisson.Clyde.Repositories;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Course;
import ovh.herisson.Clyde.Tables.User;
public interface CourseRepository extends CrudRepository<Course,Long> {
Course findById(long id);
@Query("select c from Course c where c.owner = ?1")
Iterable<Course> findAllOwnedCoures(User teacher);
}