diff --git a/src/app/view/all-users/all-users.component.ts b/src/app/view/all-users/all-users.component.ts index b2e0f4c..2f0133f 100644 --- a/src/app/view/all-users/all-users.component.ts +++ b/src/app/view/all-users/all-users.component.ts @@ -202,8 +202,8 @@ export class AllUsersComponent { error: (err) => { if (err.error.statusCode === 403) { this.toastrService.error( - 'Error:' + err.error.message, - 'Unauthorized', + "You don't have the permissions to access the users page.", + 'Access Denied', ); } else { this.toastrService.error('Error:' + err.error.message, 'Fail'); @@ -224,8 +224,8 @@ export class AllUsersComponent { error: (err) => { if (err.error.statusCode === 403) { this.toastrService.error( - 'Error:' + err.error.message, - 'Unauthorized', + "You don't have the permissions to access the users page.", + 'Access Denied', ); } else { this.toastrService.error('Error:' + err.error.message, 'Fail'); @@ -249,8 +249,8 @@ export class AllUsersComponent { error: (err) => { if (err.error.statusCode === 403) { this.toastrService.error( - 'Error:' + err.error.message, - 'Unauthorized', + "You don't have the permissions to access the users page.", + 'Access Denied', ); } else { this.toastrService.error('Error:' + err.error.message, 'Fail'); diff --git a/src/app/view/certificate-details/certificate-details.component.ts b/src/app/view/certificate-details/certificate-details.component.ts index a87f695..be196db 100644 --- a/src/app/view/certificate-details/certificate-details.component.ts +++ b/src/app/view/certificate-details/certificate-details.component.ts @@ -475,7 +475,10 @@ export class CertificateDetailsComponent { this.loading = false; if (err.error.statusCode === 403) { - this.toastrService.error('You are Unauthorized'); + this.toastrService.error( + "You don't have the permissions to access the certificate page.", + 'Access Denied', + ); } else { this.toastrService.error('Error', err.error.message); } diff --git a/src/app/view/device/add-bulk-device/add-bulk-device.component.ts b/src/app/view/device/add-bulk-device/add-bulk-device.component.ts index d6bc9a0..d0edec5 100644 --- a/src/app/view/device/add-bulk-device/add-bulk-device.component.ts +++ b/src/app/view/device/add-bulk-device/add-bulk-device.component.ts @@ -152,7 +152,10 @@ export class AddBulkDeviceComponent implements OnInit { //Error callback console.error('error caught in component', err); if (err.error.statusCode === 403) { - this.toastrService.error('You are Unauthorized'); + this.toastrService.error( + "You don't have the permissions to add devices.", + 'Access Denied', + ); } else { this.toastrService.error('error!', err.error.message); } @@ -173,7 +176,10 @@ export class AddBulkDeviceComponent implements OnInit { //Error callback console.error('error caught in component', err); if (err.error.statusCode === 403) { - this.toastrService.error('You are Unauthorized'); + this.toastrService.error( + "You don't have the permissions to add devices.", + 'Access Denied', + ); } else { this.toastrService.error('error!', err.error.message); } diff --git a/src/app/view/device/add-devices/add-devices.component.ts b/src/app/view/device/add-devices/add-devices.component.ts index ef7c897..416fb0c 100644 --- a/src/app/view/device/add-devices/add-devices.component.ts +++ b/src/app/view/device/add-devices/add-devices.component.ts @@ -356,7 +356,10 @@ export class AddDevicesComponent { //Error callback console.error('error caught in component', err.error.message); if (err.error.statusCode === 403) { - this.toastrService.error('You are Unauthorized'); + this.toastrService.error( + "You don't have the permissions to add a device.", + 'Access Denied', + ); } else { this.toastrService.error( 'some error occurred due to ' + err.error.message, diff --git a/src/app/view/device/alldevices/alldevices.component.ts b/src/app/view/device/alldevices/alldevices.component.ts index ceac409..9fca318 100644 --- a/src/app/view/device/alldevices/alldevices.component.ts +++ b/src/app/view/device/alldevices/alldevices.component.ts @@ -327,7 +327,10 @@ export class AlldevicesComponent { error: (err) => { console.log(err); if (err.error.statusCode === 403) { - this.toastrService.error('You are Unauthorized'); + this.toastrService.error( + "You don't have the permissions to access the devices.", + 'Access Denied', + ); } else { this.toastrService.error('Error', err.error.message); } diff --git a/src/app/view/organization/user-invitation/user-invitation.component.ts b/src/app/view/organization/user-invitation/user-invitation.component.ts index 4a46ac0..2b8a962 100644 --- a/src/app/view/organization/user-invitation/user-invitation.component.ts +++ b/src/app/view/organization/user-invitation/user-invitation.component.ts @@ -114,8 +114,11 @@ export class UserInvitationComponent { this.getorginviteuserlist(); } }, - error: (err) => { - this.toastrService.error('Fail', err.error.message); + error: () => { + this.toastrService.error( + "You don't have the permissions to invite a user to this organization", + 'Access Denied', + ); }, }); }