Commit Graph

20 Commits

Author SHA1 Message Date
Koncept Kit
a74f161efa Security Hardening #1 2026-01-07 14:15:50 +07:00
Koncept Kit
d818d847bc Security Hardening 2026-01-07 14:03:38 +07:00
Koncept Kit
1390e07500 Login and Session Fixes 2026-01-07 13:37:28 +07:00
Koncept Kit
810366d00f feat: Implement Option 3 - Proper RBAC with role-based staff invitations
**Problem:** Admin had users.create permission but couldn't use it due to workflow requiring superadmin-only /admin/roles endpoint.

**Solution:** Created scalable endpoint that adapts role selection to user's permission level.

**Changes:**
- NEW: GET /admin/roles/assignable endpoint with intelligent role filtering
  - Superadmin: Returns all roles
  - Admin: Returns admin, finance, non-elevated custom roles (excludes superadmin)
  - Prevents privilege escalation via permission comparison

- UPDATED: InviteStaffDialog now uses /admin/roles/assignable
  - Removed 403 fallback logic (no longer needed)
  - Backend handles role filtering dynamically

- UPDATED: AdminStaff 'Invite Staff' button back to permission-based
  - Changed from user.role === 'superadmin' to hasPermission('users.create')
  - Both admin and superadmin can now invite staff with role restrictions

**Security:**
-  Privilege escalation blocked (admin can't create superadmin)
-  Custom roles filtered by permission comparison
-  Multi-layer enforcement (frontend + backend)

**Files Modified:**
- backend/server.py (+94 lines)
- frontend/src/components/InviteStaffDialog.js (-14 lines)
- frontend/src/pages/admin/AdminStaff.js (1 line changed)
- RBAC_IMPLEMENTATION_FINAL.md (new documentation)

**Testing:**
- Superadmin can assign all roles including superadmin ✓
- Admin can assign admin and finance ✓
- Admin cannot see/assign superadmin ✓
- Custom role elevation detection working ✓
2026-01-06 14:42:25 +07:00
Koncept Kit
314380eec6 Add missing endpoints, fix batch updates, and implement RSVP status
## New Endpoints
- **GET /admin/events/{event_id}**: Get single event details (admin)
  - Allows viewing unpublished events
  - Returns full event with RSVP count

## Enhanced Endpoints
- **PUT /admin/events/{event_id}/attendance**: Accept batch updates
  - Add BatchAttendanceUpdate model for array of updates
  - Support both single and bulk attendance marking
  - Return count of updated records

- **GET /events**: Include user RSVP status in response
  - Query current user's RSVP for each event
  - Enable calendar color coding by status

- **GET /events/{event_id}**: Include user RSVP status
  - Query current user's RSVP for event details
  - Maintain consistency with list endpoint

## Bug Fixes
- **GET /members/event-activity**: Fix timezone comparison
  - Add timezone-aware conversion for event.end_at
  - Resolve "can't compare offset-naive and offset-aware" error

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-06 01:03:01 +07:00
Koncept Kit
6784148058 Fix timezone comparison error in invitation verification 2026-01-05 02:26:11 +07:00
Koncept Kit
f9bfdfa879 Superadmin nullable fix 2026-01-04 22:33:48 +07:00
Koncept Kit
487481b322 Test Preparation 2025-12-26 20:03:53 +07:00
Koncept Kit
91c7fc01e6 Donation base URL fix 2025-12-18 18:02:36 +07:00
Koncept Kit
db13f0e9de - Profile Picture\
Donation Tracking\
Validation Rejection\
Subscription Data Export\
Admin Dashboard Logo\
Admin Navbar Reorganization
2025-12-18 17:04:00 +07:00
Koncept Kit
ed5526e27b RBAC, Permissions, and Export/Import 2025-12-16 20:03:50 +07:00
Koncept Kit
b268c3fff8 Update Responsive and Contact Us page and function 2025-12-13 00:58:30 +07:00
Koncept Kit
834d65ec49 Donation page update and Subscription update on Admin Dashboard 2025-12-11 23:14:13 +07:00
Koncept Kit
7d55d29362 Stripe fix and email verification fix 2025-12-11 22:18:58 +07:00
Koncept Kit
e875700b8e Update:- Membership Plan- Donation- Member detail for Member Directory 2025-12-11 19:28:48 +07:00
Koncept Kit
f051976881 Update New Features 2025-12-10 17:52:32 +07:00
Koncept Kit
005c56b43d Email SMTP Fix 2025-12-07 16:59:04 +07:00
Koncept Kit
79b617904b Update registration Step 2025-12-06 13:47:30 +07:00
Koncept Kit
a073fca0d7 Deploy prepare 2025-12-06 00:50:35 +07:00
Koncept Kit
6ef7685ade first commit 2025-12-05 16:43:37 +07:00