@campxdev/shared 1.9.3 → 1.9.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/shared",
3
- "version": "1.9.3",
3
+ "version": "1.9.5",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -188,8 +188,15 @@ function useAuth({ permissionsEndpoint, loginUrl }: AuthParams): AuthResponse {
188
188
  const originSubdomain =
189
189
  window.location.host.split('.')?.slice(-3)[0] ?? 'ums'
190
190
  const isStaging = origin.split('campx')[1] === '.dev'
191
+ const isAdmin = checkIsAdmin(res.data.user)
192
+ const isSetup =
193
+ window.location.hostname.split('.').includes('setup') && isAdmin
194
+
195
+ // eslint-disable-next-line no-console
196
+ console.log('Is Admin -> ', isAdmin)
197
+ console.log('Is Setup -> ', isAdmin && isSetup)
191
198
 
192
- if (isDevelopment == false && isStaging == false) {
199
+ if (isDevelopment == false && isStaging == false && !isSetup) {
193
200
  if (
194
201
  !res.data.applications.includes(ApplicationObj[originSubdomain])
195
202
  ) {
@@ -209,9 +216,6 @@ function useAuth({ permissionsEndpoint, loginUrl }: AuthParams): AuthResponse {
209
216
  s.user = res.data?.user
210
217
  s.roles = res.data?.roles
211
218
  })
212
- const isAdmin = checkIsAdmin(res.data.user)
213
- // eslint-disable-next-line no-console
214
- console.log('Is Admin -> ', isAdmin)
215
219
 
216
220
  PermissionsStore.update((s) => {
217
221
  s.permissions = {
@@ -874,6 +874,7 @@ export enum Permission {
874
874
  CAN_ADMISSIONS_DASHBOARD_VIEW = 'can_admission_dashboard_view',
875
875
  CAN_ADMISSIONS_LEAD_REMARKS = 'can_admission_lead_remarks',
876
876
  CAN_ADMISSIONS_GRAPH_VIEW = 'can_admission_graph_view',
877
+ CAN_ADMISSIONS_CONFIRMED_STUDENTS = 'can_admissions_confirmed_students',
877
878
  CAN_ENROLL_X_AUDIT_LOGS = 'can_enroll_x_view_audit_logs',
878
879
  CAN_ADMISSION_APPROVAL = 'can_admission_approvals',
879
880