The xenohuru-api implements strict read-only access for public users to prevent scammers, fake listings, and malicious content. All write operations (POST, PUT, PATCH, DELETE) require admin/staff privileges.
ReadOnlyOrAdmin (app/core/permissions.py)
- GET requests: Public access (no authentication required)
- [-] POST/PUT/PATCH/DELETE: Admin/staff only
| User Type | Read (GET) | Write (POST/PUT/PATCH/DELETE) |
|---|---|---|
| Anonymous | [x] Yes | [-] No |
| Authenticated User | [x] Yes | [-] No |
| Staff/Admin | [x] Yes | [x] Yes (via API or Admin Panel) |
| Superuser | [x] Yes | [x] Yes (via API or Admin Panel) |
Risk: Fake tour companies, scam bookings, fraudulent contact information
Protection:
- Public can browse verified operators
- [-] Only admin can create new operators
- [-] Only admin can modify operator details
- Approval workflow (
is_approvedfield) - Verification badge (
is_verifiedfield)
Admin Actions:
- Verify legitimate tour operators
- Approve/reject operator submissions
- Soft delete suspicious operators
- Update contact information
Risk: Fake business partnerships, fraudulent sponsorships
Protection:
- Public can view active partners
- [-] Only admin can create partnerships
- [-] Only admin can modify partner information
- Tier system (platinum/gold/silver/community)
Admin Actions:
- Verify partner legitimacy
- Assign partnership tier
- Manage partner visibility
- Update partnership details
Risk: Phishing links, scam content, malicious redirects, spam
Protection:
- Public can read published articles
- [-] Only admin can create articles
- [-] Only admin can edit/delete articles
- Approval workflow (
is_approvedfield) - Publishing workflow (
status: draft/published/archived)
Admin Actions:
- Review article content for scams/phishing
- Approve/reject articles
- Publish/unpublish articles
- Moderate content
Risk: Impersonation, fake credentials, fraudulent expert claims
Protection:
- Public can view public profiles
- Authenticated users can update their own profile only
- [-] Only admin can create new contributor profiles
- [-] Only admin can delete profiles
- Public/private profile toggle
Admin Actions:
- Verify contributor identities
- Create profiles for verified contributors
- Moderate profile content
- Remove impersonators
Special Note: Contributors can update their own profiles, but profile creation is admin-only to prevent impersonation.
Risk: False information, dangerous locations
Protection:
- Public can browse approved attractions
- [-] Only admin can create attractions
- [-] Only admin can modify attraction data
- Approval workflow (
is_approvedfield) - Soft delete for disputed data
Admin Actions:
- Verify attraction information
- Update GPS coordinates
- Approve/reject submissions
- Manage attraction visibility
Risk: Misinformation about Tanzania's administrative divisions
Protection:
- Public can view all 31 official regions
- [-] Only admin can create/modify regions
- Official government data source
Admin Actions:
- Update region descriptions
- Correct data errors
- Maintain official region list
All content goes through a multi-step approval process:
1. CREATION (Admin only)
β
2. REVIEW (Admin panel)
β
3. APPROVAL (is_approved = True)
β
4. PUBLIC VISIBILITY (API shows approved content)
β
5. MONITORING (Track API usage, detect abuse)
β
6. SOFT DELETE if suspicious (deleted_at timestamp)
All content must be created through the Django admin panel by staff/superusers:
- Tour Operators:
/admin/operators/touroperator/add/ - Partners:
/admin/partners/partner/add/ - Articles:
/admin/blog/article/add/ - Contributors:
/admin/contributors/creatorprofile/add/ - Attractions:
/admin/attractions/attraction/add/ - Regions:
/admin/regions/region/add/
Available in list views:
- Approve - Make content public
- β Reject - Hide from public
- βΊ Restore - Recover soft-deleted items
- ποΈ Move to trash - Soft delete
{
"detail": "Authentication credentials were not provided."
}Cause: Attempting write operation without authentication
{
"detail": "You do not have permission to perform this action."
}Cause: Authenticated user (non-admin) attempting write operation
Solution: Use admin panel or contact administrator
-
Fake Tour Operators
- Scammers create fake tour companies
- Collect deposits and disappear
- Damage Tanzania's tourism reputation
-
Phishing Content
- Fake blog articles with malicious links
- Redirect users to scam websites
- Steal personal/financial information
-
Fraudulent Partnerships
- Fake businesses claim partnerships
- Use API credentials to seem legitimate
- Damage partner brand reputation
-
Impersonation
- Fake expert profiles
- False credentials and testimonials
- Mislead travelers with bad advice
[x] Benefits:
- Prevents automated scam submissions
- Requires admin verification before content goes live
- Protects travelers from fraud
- Maintains data quality
- Preserves Tanzania tourism reputation
- Enables trust through verification
[-] Trade-offs:
- Users cannot self-register as operators
- Content submission requires admin approval
- Less "open" than fully public APIs
Decision: Safety and trust are more important than convenience.
Tour Operators & Partners:
- Email: admin@xenohuru.com
- Provide: Business registration, licenses, references
- Admin will verify and create your listing
- You'll receive credentials to manage your profile (future feature)
Contributors:
- Apply through contact form
- Provide credentials and portfolio
- Admin creates verified profile
- You can update your own profile after approval
Attractions:
- Submit via contact form with evidence
- Admin verifies information
- Attraction added to database
- Community can suggest edits via admin
All API requests are logged:
- Endpoint accessed
- HTTP method
- User (if authenticated)
- IP address
- Response time
- Status code
Access via admin panel: /admin/core/apiusage/
Monitors for:
- Repeated failed write attempts (potential attackers)
- Unusual access patterns
- Excessive read requests (potential scrapers)
# [x] Read - Works
curl https://xenohuru.cleven.is-a.dev/api/v1/operators/
# [-] Write - Blocked (401)
curl -X POST https://xenohuru.cleven.is-a.dev/api/v1/operators/ \
-H "Content-Type: application/json" \
-d '{"name":"Fake Company"}'# [x] Read - Works
curl https://xenohuru.cleven.is-a.dev/api/v1/operators/ \
-H "Authorization: Bearer <token>"
# [-] Write - Blocked (403)
curl -X POST https://xenohuru.cleven.is-a.dev/api/v1/operators/ \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"name":"My Company"}'# [x] Read - Works
curl https://xenohuru.cleven.is-a.dev/api/v1/operators/ \
-H "Authorization: Bearer <admin_token>"
# [x] Write - Works
curl -X POST https://xenohuru.cleven.is-a.dev/api/v1/operators/ \
-H "Authorization: Bearer <admin_token>" \
-H "Content-Type: application/json" \
-d '{"name":"Verified Company", ...}'-
Verified User Submissions
- Allow verified tour operators to update their own profiles
- Require admin approval for changes
- Email notifications for approval/rejection
-
Public Contribution System
- Users can suggest attraction edits
- Stored in moderation queue
- Admin reviews and approves changes
-
Rate Limiting
- Prevent API abuse
- Throttle excessive requests
- Protect against DDoS
-
Reputation System
- Track user behavior
- Ban abusive users
- Whitelist trusted partners
Security Concerns: **********
Business Listings: **********
General Support: **********
Last Updated: 2026-03-19
Policy Version: 1.0