== Writer Views Story Collaboration Details === Actor: **Writer** A writer views all current collaborators on their story, including their roles and permission levels, and can manage the collaboration. **1.** The writer navigates to their story management page and selects "Manage Collaborators". **2.** The system retrieves all collaborators and their details for the story. {{{#!sql SELECT u.username, u.name, u.surname, r.roles, p.permission_level, c.created_at FROM COLLABORATION c JOIN USERS u ON c.user_id = u.user_id JOIN ROLES r ON c.user_id = r.user_id AND c.story_id = r.story_id JOIN PERMISSION_LEVEL p ON c.user_id = p.user_id AND c.story_id = p.story_id WHERE c.story_id = 5 ORDER BY p.permission_level DESC; }}} **3.** The writer decides to update a collaborator's permission level. {{{#!sql UPDATE PERMISSION_LEVEL SET permission_level = 3 WHERE user_id = 9 AND story_id = 5; }}} **4.** The writer decides to remove a collaborator from the story entirely. {{{#!sql DELETE FROM COLLABORATION WHERE user_id = 9 AND story_id = 5; }}} **5.** The system confirms the changes and the ROLES and PERMISSION_LEVEL records are automatically removed via CASCADE. **6.** The system sends a notification to the removed collaborator. {{{#!sql INSERT INTO NOTIFICATION (content, is_read, created_at) VALUES ('You have been removed as a collaborator from "Letters from Constantinople"', FALSE, CURRENT_TIMESTAMP); }}} }}}