mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-15 03:08:44 +02:00
Restrict AI features to administrators only for improved control
Update routes and sidebar to enforce admin-only access for AI features, including model retrieval, text generation, and history viewing. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/G1P4XGr
This commit is contained in:
1 parent
e74ff88a07
commit
f291fc000b
4 files changed
+32
-5
No files matched your search
+3
-3
@@ -424,7 +424,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
});
|
||||
|
||||
// Get available AI models from OpenRouter
|
||||
app.get("/api/ai/models", requireAuth, async (req, res) => {
|
||||
app.get("/api/ai/models", requireAdmin, async (req, res) => {
|
||||
try {
|
||||
const models = await openRouterService.getAvailableModels();
|
||||
res.json({ models });
|
||||
@@ -435,7 +435,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
});
|
||||
|
||||
// AI text generation
|
||||
app.post("/api/ai/generate", requireAuth, async (req, res) => {
|
||||
app.post("/api/ai/generate", requireAdmin, async (req, res) => {
|
||||
try {
|
||||
const user = req.user as User;
|
||||
const userId = user.id;
|
||||
@@ -937,7 +937,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
});
|
||||
|
||||
// AI Generations
|
||||
app.get("/api/ai/generations", requireAuth, async (req, res) => {
|
||||
app.get("/api/ai/generations", requireAdmin, async (req, res) => {
|
||||
try {
|
||||
const user = req.user as User;
|
||||
const userId = user.id;
|
||||
|
||||
Reference in new issue
Block a user