# Data Privacy and Ethical Considerations in Database Management
## 5 Results and Analysis
### Access Controls  
To implement access control on data using pgAdmin4, we adopted an approach that involved assigning permissions to database users. This included granting specific access privileges, such as SELECT, INSERT, UPDATE, and DELETE, only to users who required these permissions to perform their functions.  
Initially, the user (or role) \"henrique\" was created in PostgreSQL using the command \"CREATE ROLE henrique LOGIN PASSWORD'string' \". Then \"henrique\" was granted a role with \"SELECT\" and \"INSERT\" permissions for all tables in the public schema through the \"GRANT\" command. The \"UPDATE\" and \"DELETE\" permissions were revoked, using the \"REVOKE\" command to ensure more restricted data management. Furthermore, additional restrictions were applied to user \"henrique\", allowing him to authenticate and access the database using credentials. Some examples prevent him from having all administrative privileges (superuser), creating databases, creating new users (or roles), inheriting parental role privileges, and initiating streaming replication and backups.  
User \"afonso\" received the \"SELECT\" permission for all tables in the public schema and the \"INSERT\", \"UPDATE\", and \"DELETE\" permissions were revoked. Likewise, additional restrictions were applied, very much similar to user \"henrique\".  
Lastly, user \"eduardo\" was granted \"SELECT\", \"INSERT\", \"UPDATE\", and \"DELETE\" permissions for all tables in the public schema. Additional restrictions were applied to user \"eduardo\", allowing him to authenticate and access the database using credentials, preventing him from being a superuser, allowing him to create databases, create new  
Figure 7: Query execution before and after encryption.  
users or roles, inherit privileges from parental roles, and initiate streaming replication and backups.  
These measures aim to guarantee precise and granular control of access to data, thus promoting the security and integrity of information stored in the health database against unauthorized access and improper manipulation.  
Ethical Considerations in Access Control  
Implementing access controls raises several ethical considerations:  
* Balancing Access and Privacy: While restricting access enhances privacy, it may limit legitimate data use for research or patient care. This presents an ethical challenge in balancing data protection with data utility [52].
* Transparency and Accountability: It is crucial to maintain transparency about access control policies and ensure accountability for data access [75].
* Fairness in Access Distribution: The distribution of access rights must be fair and based on legitimate needs, avoiding any form of discrimination [53].
* Continuous Review: Access rights should be regularly reviewed to ensure they remain appropriate, reflecting the ethical responsibility to maintain data security over time [76].  
In conclusion, implementing these data management practices has proven critical to ensuring compliance with privacy regulations, protecting the confidentiality of health information, and promoting user confidence in the ethical management and use of data. These measures contribute significantly to mitigating the risks of privacy violations and ensuring respect for patients' rights, even though they may minimally influence the speed and efficiency of the database.