Course contentsShow
← Web Development
Lesson 2955 of 2,98253. Privacy and ComplianceFree lesson

Legal Bases for Data Processing

Learn the six legal bases under GDPR for processing personal data and how they apply to web applications.

Legal Bases for Data Processing

You'll learn the six legal foundations GDPR provides for lawfully processing user data in your web application.

What Are Legal Bases?

Under GDPR, you cannot simply process personal data whenever you want. You must have a legal basis—a valid justification recognized by law. Think of these like different "permission slips" that allow you to collect and use user information, each appropriate for different situations.

The Six Legal Bases

1. Consent — The user actively agrees (e.g., checking a checkbox). This is your go-to for marketing emails and non-essential cookies. Consent must be freely given, specific, informed, and easily withdrawable.

2. Contract — Processing is necessary to fulfill a contract with the user. Example: storing shipping addresses to deliver purchased products.

3. Legal Obligation — You're required by law to process data. Example: retaining transaction records for tax compliance.

4. Vital Interests — Necessary to protect someone's life. Rarely applicable to typical web apps.

5. Public Task — Processing performed by public authorities. Usually not relevant for commercial websites.

6. Legitimate Interests — You have a legitimate business reason that doesn't override user privacy rights. Example: fraud prevention or internal analytics. This requires a balancing test—your interests vs. user privacy.

Choosing the Right Basis

Different features need different bases. Authentication data might rely on contract, while newsletter subscriptions need consent. Analytics might use legitimate interests (with careful justification) or consent (safer choice). You must document which basis applies to each processing activity—this isn't just a formality; regulators will ask.

You cannot switch bases freely after collection, so choose carefully upfront.

Key Takeaway: GDPR requires one of six legal bases (consent, contract, legal obligation, vital interests, public task, or legitimate interests) to lawfully process personal data—choose the appropriate basis for each feature and document your reasoning.