Overview

Ananas GDS uses a flat permission model for sub-users. Each sub-user has a UserPermission record with boolean flags for each feature area. Owners (managers) bypass all permission checks and have full access.

Permission Flags

FlagControls Access To
propertiesCreate, edit, and delete properties.
factsEdit fact sheet content.
photosUpload and manage photos.
stop_salesCreate and edit stop sale events.
companyEdit company profile and settings.
contacts_managerManage mailing lists and contacts.
premium_subscriptionView and manage billing and subscriptions.
developer_toolsAPI keys, widgets, integrations, webhooks, exports.
partner_connectionsSend and manage partner contracts.
publishing_managerApprove or decline fact sheet publications.

User Roles

Each sub-user has an optional role label for organisational purposes. The role does not directly gate features — only the boolean flags do. Roles: GM (General Manager), Res (Reservations), FO (Front Office), PR (PR/Marketing), IT (IT/Tech).

Sub-User Gate Pattern

All protected backend views follow this pattern consistently:

Python — sub-user gate
if not user.is_manager():
    perms = UserPermission.objects.filter(user=user).first()
    if not perms or not perms.<flag>:
        return Response({'message': 'Not permitted.'}, status=403)

Property-Level Access

Beyond feature flags, sub-users can be restricted to specific properties via SubUserPropertyAccess records. If no property access records exist for a sub-user, they can see all properties (the flag alone gates the feature). SubUserRegionAccess provides region-level scoping for larger portfolios.