RezinaLMS-BackEnd/db/migrations/000085_team_profile_update_mine.up.sql
Yared Yemane f3fa551be4 feat: add PUT /team/me self-service profile update and admin docs
Let team members update their own profile without admin routes, seed team.profile.update_mine RBAC, and add FAQ/personas/ratings admin integration guides.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 03:46:22 -07:00

15 lines
585 B
SQL

INSERT INTO permissions (key, name, description, group_name) VALUES
('team.profile.update_mine', 'Update My Team Profile', 'Update own team profile', 'Team')
ON CONFLICT (key) DO UPDATE SET
name = EXCLUDED.name,
description = EXCLUDED.description,
group_name = EXCLUDED.group_name;
INSERT INTO role_permissions (role_id, permission_id)
SELECT r.id, p.id
FROM roles r
CROSS JOIN permissions p
WHERE r.name IN ('ADMIN', 'INSTRUCTOR', 'SUPPORT')
AND p.key IN ('team.profile.get_mine', 'team.profile.update_mine', 'team.members.change_password')
ON CONFLICT DO NOTHING;