MOO WebTech
Database Securitypracticeadvanced

DCL Practice

Hands-on practice: configuring roles, granting privileges, and testing access control.

80 minL49

Overview

Students practise setting up a multi-role permission model. Tasks simulate common real-world scenarios: a read-only reporting user, a write-access application user, and an admin role. Each student sets up their own environment and tests the permissions.

Lesson Plan

TimeActivity
0–10 minRecap: DCL commands and role hierarchy
10–20 minWalk through first task together
20–60 minHands-on work: configure roles and test access
60–75 minReview: connect as each role and verify permissions
75–80 minWrap-up

Key Concepts

  • Testing permissions by connecting with the target role
  • SET ROLE role_name to switch roles within a session
  • \dp (psql) or information_schema views to inspect current grants
  • Schema-level USAGE privilege required before object-level grants
  • Revoking from PUBLIC to remove default privileges

✏️Practice

Tasks will be provided during the lesson.