mirror of
https://github.com/matrix-construct/construct
synced 2024-11-17 15:30:52 +01:00
modules/vm: Check auth during eval.
This commit is contained in:
parent
7cc37e517a
commit
7fa5948fd3
2 changed files with 7 additions and 0 deletions
|
@ -156,6 +156,9 @@ struct ircd::m::vm::opts
|
|||
/// Call eval hooks or false to bypass this stage.
|
||||
bool eval {true};
|
||||
|
||||
/// Perform auth or false to bypass this state.
|
||||
bool auth {true};
|
||||
|
||||
/// Make writes to database
|
||||
bool write {true};
|
||||
|
||||
|
|
|
@ -896,6 +896,10 @@ ircd::m::vm::execute_pdu(eval &eval,
|
|||
if(opts.fetch)
|
||||
call_hook(fetch_hook, eval, event, eval);
|
||||
|
||||
// Evaluation by auth system; throws
|
||||
if(opts.auth && !internal(room_id))
|
||||
event::auth::check(event);
|
||||
|
||||
// Obtain sequence number here.
|
||||
const auto *const &top(eval::seqmax());
|
||||
eval.sequence_shared[0] = 0;
|
||||
|
|
Loading…
Reference in a new issue