File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
src/backend/src/routers/filesystem_api/fs_tree_manager Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 1919
2020'use strict' ;
2121
22+ const { Context } = require ( '../../../../util/context' ) ;
23+
2224// -----------------------------------------------------------------------//
2325// WebSocket handler for replica/fetch
2426// -----------------------------------------------------------------------//
2527module . exports = {
2628 event : 'replica/fetch' ,
2729 handler : async ( socket , _data ) => {
30+ const svc_permission = Context . get ( 'services' ) . get ( 'permission' ) ;
31+ const can_access = await svc_permission . check ( 'endpoint:replica/fetch' ) ;
32+ if ( ! can_access ) {
33+ return socket . emit ( 'replica/fetch/error' , {
34+ success : false ,
35+ error : { message : 'permission denied' } ,
36+ } ) ;
37+ }
38+
2839 // Import gRPC client and protobuf classes from common
2940 const {
3041 getClient,
You can’t perform that action at this time.
0 commit comments