Area Security¶
Area security restricts which users can track in which geofence areas, based on Discord roles or Telegram group membership.
Enabling Area Security¶
| Option | Default | Description |
|---|---|---|
enabled |
false |
Enable area-based access controls |
strictLocations |
false |
Also restrict distance-based tracking to allowed areas |
Defining Communities¶
Communities map areas to access requirements:
{
"areaSecurity": {
"enabled": true,
"communities": {
"downtown": {
"discord": {
"allowedRoles": ["ROLE_ID_1"],
"allowedChannels": ["CHANNEL_ID_1"]
},
"telegram": {
"allowedGroups": ["GROUP_ID_1"]
},
"areas": ["Downtown", "City Centre"]
},
"suburbs": {
"discord": {
"allowedRoles": ["ROLE_ID_2"]
},
"areas": ["North Suburbs", "South Suburbs", "East Suburbs"]
}
}
}
}
Community Fields¶
| Field | Description |
|---|---|
areas |
Array of geofence area names this community controls |
discord.allowedRoles |
Discord role IDs that grant access |
discord.allowedChannels |
Discord channel IDs where this community's commands work |
telegram.allowedGroups |
Telegram group IDs that grant access |
How It Works¶
- When a user tries to add an area to their profile, Dexter checks if the area belongs to a community
- If it does, Dexter checks if the user has the required role (Discord) or is a member of the required group (Telegram)
- If the user doesn't have access, the command is rejected with a message
Strict Locations¶
When strictLocations is true, distance-based tracking is also restricted. A user's location must fall within an area they have access to, or distance-based tracking is denied.
Example¶
A setup with two communities — "City" requires a Discord role, "Rural" is open to everyone in a specific channel: