Refactor routes and controllers for RESTful resource access
Updated controllers and routes to use RESTful resource-based URLs and parameter passing for groups, users, and notification channels. Added user isolation checks for domain and group access, ensuring proper data filtering based on isolation mode. Adjusted views to match new route structure and improved security and maintainability by removing reliance on query parameters for resource identification.
This commit is contained in:
@@ -63,7 +63,10 @@ class NotificationGroup extends Model
|
||||
// Get domains (filtered by user if needed)
|
||||
$domainModel = new Domain();
|
||||
if ($userId) {
|
||||
$group['domains'] = $domainModel->where('notification_group_id', $id, $userId);
|
||||
$sql = "SELECT * FROM domains WHERE notification_group_id = ? AND user_id = ?";
|
||||
$stmt = $this->db->prepare($sql);
|
||||
$stmt->execute([$id, $userId]);
|
||||
$group['domains'] = $stmt->fetchAll();
|
||||
} else {
|
||||
$group['domains'] = $domainModel->where('notification_group_id', $id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user