File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -170,14 +170,15 @@ const findSharedModel = async (sharedId) => {
170
170
return new Promise ( async ( resolve , reject ) => {
171
171
try {
172
172
const model = await modelRepository . findOne ( { "shareOptions._id" : sharedId } ) ;
173
- if ( model === null || model . shareOptions === null || ! model . shareOptions . active || ! model . shareOptions . importAllowed ) {
173
+ if ( model === null || model . shareOptions === null || ! model . shareOptions . active ) {
174
174
reject ( "unauthorized" ) ;
175
175
}
176
176
return resolve ( {
177
177
"id" : model . shareOptions . _id ,
178
178
"model" : model . model ,
179
179
"type" : model . type ,
180
- "name" : model . name
180
+ "name" : model . name ,
181
+ "importAllowed" : model . shareOptions . importAllowed ,
181
182
} ) ;
182
183
} catch ( error ) {
183
184
console . error ( error ) ;
@@ -203,6 +204,10 @@ const importModel = async (sharedId, userId) => {
203
204
try {
204
205
const sharedModel = await findSharedModel ( sharedId ) ;
205
206
207
+ if ( ! sharedModel . importAllowed ) {
208
+ reject ( "unauthorized" ) ;
209
+ }
210
+
206
211
const newModel = {
207
212
"name" : sharedModel . name ,
208
213
"type" : sharedModel . type ,
You can’t perform that action at this time.
0 commit comments