mirror of
https://github.com/ent/ent.git
synced 2026-05-22 09:31:45 +03:00
entc/gen: check runtime import before executing privacy rules (#1054)
This commit is contained in:
@@ -295,6 +295,9 @@ func (uq *UserQuery) prepareQuery(ctx context.Context) error {
|
||||
}
|
||||
uq.sql = prev
|
||||
}
|
||||
if user.Policy == nil {
|
||||
return errors.New("ent: uninitialized user.Policy (forgotten import ent/runtime?)")
|
||||
}
|
||||
if err := user.Policy.EvalQuery(ctx, uq); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user