feat: add SMTP email support and fix profile/permissions bugs
This commit is contained in:
@@ -96,13 +96,14 @@ func (c *Checker) CheckChannelPermission(ctx context.Context, serverID, userID,
|
||||
}
|
||||
|
||||
// Layer channel overrides: apply deny first (subtract), then allow (add).
|
||||
// Role-based overrides from all user roles, then user-specific override.
|
||||
// Role-based overrides from all user roles, plus the @everyone role, then user-specific override.
|
||||
rows, err := c.db.QueryContext(ctx, `
|
||||
SELECT co.allow_bitflags, co.deny_bitflags
|
||||
FROM channel_overrides co
|
||||
WHERE co.channel_id = $1 AND co.target_type = 'role'
|
||||
AND co.target_id IN (
|
||||
SELECT mr.role_id FROM member_roles mr WHERE mr.user_id = $2 AND mr.server_id = $3
|
||||
AND (
|
||||
co.target_id IN (SELECT mr.role_id FROM member_roles mr WHERE mr.user_id = $2 AND mr.server_id = $3)
|
||||
OR co.target_id = (SELECT id FROM roles WHERE server_id = $3 AND is_default = TRUE LIMIT 1)
|
||||
)
|
||||
`, channelID, userID, serverID)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user