File tree 1 file changed +17
-2
lines changed
1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -124,14 +124,29 @@ exports.runExpress = async ({
124
124
125
125
app . use ( express . json ( ) ) ;
126
126
127
+ app . get ( '/persist/!allnamespaces' , ( req , res ) => {
128
+ const globalTopic = TOPICS . PUBLISH . SCENE_OBJECTS . formatStr ( {
129
+ nameSpace : '+' ,
130
+ sceneName : '+' ,
131
+ userClient : '+' ,
132
+ objectId : '+' ,
133
+ } ) ;
134
+ if ( jwk && ! matchJWT ( globalTopic , req . jwtPayload . subs ) ) { // Must have staff rights
135
+ return tokenSubError ( res ) ;
136
+ }
137
+ ArenaObject . distinct ( 'namespace' ) . then ( ( namespaces ) => {
138
+ return res . json ( namespaces ) ;
139
+ } ) ;
140
+ } ) ;
141
+
127
142
app . get ( '/persist/!allscenes' , ( req , res ) => {
128
143
const globalTopic = TOPICS . PUBLISH . SCENE_OBJECTS . formatStr ( {
129
144
nameSpace : '+' ,
130
145
sceneName : '+' ,
131
146
userClient : '+' ,
132
147
objectId : '+' ,
133
148
} ) ;
134
- if ( jwk && ! matchJWT ( globalTopic , req . jwtPayload . subs ) ) { // Must have sub-all rights
149
+ if ( jwk && ! matchJWT ( globalTopic , req . jwtPayload . subs ) ) { // Must have staff rights
135
150
return tokenSubError ( res ) ;
136
151
}
137
152
ArenaObject . aggregate ( [
@@ -163,7 +178,7 @@ exports.runExpress = async ({
163
178
userClient : '+' ,
164
179
objectId : '+' , // arbitrary object
165
180
} ) ;
166
- if ( jwk && ! matchJWT ( namespaceTopic , req . jwtPayload . subs ) ) { // Must have sub-all public rights
181
+ if ( jwk && ! matchJWT ( namespaceTopic , req . jwtPayload . subs ) ) { // Must have namespace rights
167
182
return tokenSubError ( res ) ;
168
183
}
169
184
ArenaObject . aggregate ( [
You can’t perform that action at this time.
0 commit comments