This commit is contained in:
payacom
2026-09-13 21:32:36 +03:30
parent 90c5f94b57
commit c302aea177
49 changed files with 4063 additions and 920 deletions

View File

@@ -71,6 +71,23 @@ const adminSchema = new mongoose.Schema({
last_online: {
type: Date, // ذخیره تاریخ و زمان آخرین بازدید
default: Date.now // تنظیم تاریخ به تاریخ فعلی
},
// super_admin: به همه‌چیز دسترسی داره (بدون نیاز به لیست permissions). staff: فقط به
// مواردی که توی permissions هست. پیش‌فرض super_admin تا ادمین‌های از قبل موجود بعد
// از این تغییر دسترسیشون رو از دست ندن
role: {
type: String,
enum: ['super_admin', 'staff'],
default: 'super_admin'
},
permissions: {
type: [String],
default: []
},
createdBy: {
type: mongoose.Schema.Types.ObjectId,
ref: 'Admin',
default: null
}
})