برنامه نویسی
دستیار محتوای هوش مصنوعی با کنترل دسترسی مبتنی بر نقش (RBAC)

این ارسال من برای [https://Permit.io Dev Challenge]
#permit #should #rbbang #javasscript #webdev #ai
🔍 آنچه من ساختم
در دستیار محتوای هوش مصنوعی کجا:
- کاربران محتوا را برای خلاصه AI ارسال می کنند.
- سرپرستان می توانند بررسی ، تأیید ، رد و انتشار خلاصه ها
- RBAC با استفاده از آن اداره می شود permit.io برای اطمینان از اقدامات مجاز فقط.
💡 خلاصه AI به دلیل محدودیت API مسخره می شود ، اما RBAC و جریان کاملاً کاربردی هستند!
🎯 مشکلی که حل می کند
محتوای تولید شده AI قدرتمند است ، اما انتشار آن بدون بررسی می تواند منجر به اطلاعات نادرست شود.
این ابزار با اطمینان از حل آن کمک می کند:
- کاربران می توانند از هوش مصنوعی برای تولید پیش نویس استفاده کنند.
- تنها نقش های تأیید شده (سرپرستان) می تواند آن محتوا را منتشر یا تأیید کند.
🌟 نسخه ی نمایشی
🔗 برنامه زنده:[https://ai-content-review-fjt8vercelapp/)[https://ai-content-review-fjt8vercelapp/)
📁 repo github: https://github.com/ravi-coding/ai-content-review
🛠 چگونه من آن را ساختم
- جبهه: React (Vite) + TypeScript + tailwind CSS
- پشت: Express.js + node.js
-
اعتبار:
@permit.io/sdk
- میزبان: Vercel (Frontend) ، رندر (پس زمینه)
- خلاصه AI: در حال حاضر مسخره شده است (می توان با استفاده از OpenAI گسترش یافت)
🔐 RBAC با permit.io
با استفاده از permit.check(user, action, resource)
برای تأیید دسترسی.
ts
const allowed = await permit.check(user, "summarize", "content");
if (!allowed) {
return res.status(403).json({ error: "Access Denied" });
}
## 🔐 Roles Defined
- **user**: Can submit content
- **admin**: Can approve, delete, and publish
---
## 🖥️ Dashboards Included
### User Dashboard:
- Submit content
- View status
### Admin Dashboard:
- View all submissions
- Approve / Delete / Publish
---
## 💡 Lessons & Challenges
- 🔄 Mocked AI summaries to simulate production AI logic
- 🛡️ Implemented clean role-based permissions using Permit.io’s policy UI
- ⚠️ Error handling and fallback logic to ensure seamless UX
---
## 🙌 Special Thanks
Huge thanks to **Permit.io** for this opportunity and their powerful SDK + Policy Studio!
---
## 📌 Final Thoughts
Permit.io made it **incredibly easy** to manage permissions without hardcoding logic.
This challenge helped me understand how secure AI tools can be built in real-world production.
Feel free to try it out and give feedback 🙏