qpp-style 9.30.2-mo-beta.0 → 9.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -173,13 +173,14 @@ const isImpersonating = (docCookie) => {
173
173
  */
174
174
  const isMultiRoleUser = (docCookie) => {
175
175
  const activeRoles = new Set();
176
- const { qpp_cms_internal_authorized, qpp_has_authorizations } =
177
- cookie.parse(docCookie);
176
+ const {
177
+ qpp_cms_internal_authorized,
178
+ qpp_has_authorizations,
179
+ qpp_is_dev_pre,
180
+ } = cookie.parse(docCookie);
178
181
 
179
182
  let internalAuthz = [];
180
- if (qpp_has_authorizations) {
181
- return activeRoles.add('qpp user');
182
- }
183
+
183
184
  if (qpp_cms_internal_authorized) {
184
185
  internalAuthz = JSON.parse(qpp_cms_internal_authorized);
185
186
  }
@@ -201,6 +202,15 @@ const isMultiRoleUser = (docCookie) => {
201
202
  return activeRoles.add(element);
202
203
  });
203
204
 
205
+ if (qpp_has_authorizations === 'true') {
206
+ activeRoles.add('qpp user');
207
+ }
208
+
209
+ if (qpp_is_dev_pre === 'true') {
210
+ activeRoles.clear(); // reset roles since there is no dropdown in devpre
211
+ activeRoles.add('devpre user');
212
+ }
213
+
204
214
  return activeRoles.size > 1;
205
215
  };
206
216