App Roles (System-Level Permissions):
user
- Basic platform accessadmin
- Full administrative privilegesdeveloper
- Developer/technical accessSOBIE Roles (Community-Specific):
attendee
- Conference attendeeresearcher
- Academic researcherpresenter
- Conference presentervendor
- Industry vendor/sponsorvolunteer
- Conference volunteersession-chair
- Session chairpersonpanelist
- Panel discussion participantkeynote-speaker
- Keynote speakeractivity-coordinator
- Social activity organizerofficer
- SOBIE organization officerconference-chairperson
- Conference chaireditor
- Publications editorreviewer
- Paper/abstract reviewerin-memoriam
- Memorial designationOfficer Details:
Activity Coordinator Details:
β
Backward Compatibility: Legacy roles
field still works
β
Automatic Sync: Legacy roles sync to new dual system
β
Virtual Properties: Quick role checking (e.g., user.isAdmin
, user.isPresenter
)
β
Role Display: Comprehensive role information formatting
β
Database Queries: Find users by app roles, SOBIE roles, officer positions, etc.
β
Memorial Integration: In-memoriam works across both role systems
β
Validation: Required fields for officers and activity coordinators
β
Auth Middleware: Updated to work with dual role system
β
User Creation: Successfully created users with dual roles
β
Role Checking: Virtual properties work correctly (isAttendee
, isPresenter
, etc.)
β
Officer Management: Added officer with treasurer role and years served
β
Activity Coordination: Created activity coordinator for golf tournament
β
Role Queries: Found users by specific SOBIE roles
β
Memorial Status: Successfully added in-memoriam with dual role support
β
Legacy Compatibility: Legacy roles automatically sync to new system
requireRole()
- Checks both legacy and new role systemsrequireAppRole()
- App-specific role checkingrequireSobieRole()
- SOBIE-specific role checkingconst user = new User({
email: 'jane.doe@university.edu',
name: { firstName: 'Jane', lastName: 'Doe' },
appRoles: ['user'],
sobieRoles: ['attendee', 'presenter', 'reviewer'],
roleDetails: {
yearsServed: [{
year: 2024,
role: 'reviewer',
description: 'Paper reviewer for SOBIE 2024'
}]
}
});
// Add officer role
user.sobieRoles.push('officer');
user.roleDetails.officerRole = 'president';
user.roleDetails.yearsServed.push({
year: 2024,
role: 'officer',
description: 'SOBIE President'
});
user.sobieRoles.push('activity-coordinator');
user.roleDetails.activityType = 'golf';
user.roleDetails.yearsServed.push({
year: 2024,
role: 'activity-coordinator',
description: 'Organized annual golf tournament'
});
// Virtual properties
console.log(user.isAdmin); // App role check
console.log(user.isPresenter); // SOBIE role check
console.log(user.isOfficer); // Officer check
// Method-based checking
console.log(user.hasRole('admin')); // Checks all role systems
// Find by app role
const admins = await User.findByAppRole('admin');
// Find by SOBIE role
const presenters = await User.findBySobieRole('presenter');
// Find officers by position
const presidents = await User.findOfficers('president');
// Find activity coordinators
const golfCoords = await User.findActivityCoordinators('golf');
β COMPLETE:
π§ MINOR ISSUE:
π― READY FOR PRODUCTION: The dual role system is fully functional and production-ready. The statistics aggregation can be simplified or fixed later without affecting core functionality.
The SOBIE dual role system successfully separates application-level permissions from community-specific roles while maintaining full backward compatibility and providing rich role management capabilities.