canove / whaticket-community

A very simple Ticket System based on WhatsApp messages, that allow multi-users in same WhatsApp account.
MIT License
1.67k stars 846 forks source link

Feature/implement company access level #573

Closed lucas-figueira closed 1 year ago

lucas-figueira commented 1 year ago

What type of PR is this?

Description

This Pull Request aims to enhance the application by introducing validation checks for users associated with companies. The primary focus has been on ensuring that users can only perform actions within the context of their respective companies. The changes have been implemented in key endpoints, including the Login, User Creation, and User List methods.

Changes Made:

  1. Login Endpoint: Added a validation step during user login to ensure that the provided company context is valid & Updated the authentication flow to consider the company context for authorization.

  2. User Creation Endpoint: Extended the user creation process to include company association & Implemented a check to ensure that the specified company is valid before allowing user creation.

  3. User List Endpoint: Modified the user list retrieval to filter users based on their associated companies & Introduced a company context parameter to restrict user list retrieval to a specific company.

Benefits

How I Tested This

Recordings

WhaTicket

Next Steps

Added/updated tests?

sonarcloud[bot] commented 1 year ago

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
9.0% 9.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint