Summary
Create a script that allows developers to quickly populate CKAN with test users, organizations, and datasets for development and testing purposes.
Description
Based on the existing test plan in docs/test-potree-permissions.md, we need automated scripts to set up a complete test environment with different user permission levels and sample data.
Requirements
Core Functionality
- Create test users with different permission levels:
- Sysadmin users
- Regular users
- Organization editors
- Create test organizations with proper member assignments
- Create sample datasets within organizations
- Generate API tokens for all test users
- Support both development and production environments
Script Structure
scripts/
├── dev-setup/
│ ├── populate-ckan.sh # Main population script
│ ├── create-users.sh # User creation utilities
│ ├── create-orgs.sh # Organization setup
│ ├── create-datasets.sh # Sample dataset creation
│ └── cleanup.sh # Environment cleanup
User Types to Create
- Admin User (
admin): Sysadmin with full permissions
- Org Editor (
org-editor): Editor role in test organization
- Regular User (
regular-user): Standard user with no special permissions
- Guest User (
guest): Minimal permissions for testing
Organizations to Create
test-org: Primary test organization
research-group: Secondary organization for multi-org testing
public-data: Organization for public datasets
Sample Datasets
- Potree point cloud datasets with scene.json5 files
- Regular file uploads
- Datasets with different visibility levels (public/private)
- Datasets in different organizations
Implementation Details
Environment Detection
- Auto-detect development vs production environment
- Use appropriate Docker Compose files (
docker-compose.dev.yml vs docker-compose.yml)
- Handle different CKAN container names
Configuration Options
# Usage examples
./scripts/dev-setup/populate-ckan.sh --env dev
./scripts/dev-setup/populate-ckan.sh --env prod --users-only
./scripts/dev-setup/populate-ckan.sh --cleanup
API Token Management
- Generate and display API tokens for all created users
- Option to save tokens to file for automated testing
- Support for both CKAN 2.9 API tokens and legacy API keys
Acceptance Criteria
Files Referenced
docs/test-potree-permissions.md - Contains the manual commands to automate
CLAUDE.md - Docker commands and environment setup
.env.dev.config / .env.prod.config - Environment configuration
Benefits
- Faster development environment setup
- Consistent test data across developer machines
- Automated testing capabilities
- Easy permission testing for new features
- Simplified onboarding for new developers
Summary
Create a script that allows developers to quickly populate CKAN with test users, organizations, and datasets for development and testing purposes.
Description
Based on the existing test plan in
docs/test-potree-permissions.md, we need automated scripts to set up a complete test environment with different user permission levels and sample data.Requirements
Core Functionality
Script Structure
User Types to Create
admin): Sysadmin with full permissionsorg-editor): Editor role in test organizationregular-user): Standard user with no special permissionsguest): Minimal permissions for testingOrganizations to Create
test-org: Primary test organizationresearch-group: Secondary organization for multi-org testingpublic-data: Organization for public datasetsSample Datasets
Implementation Details
Environment Detection
docker-compose.dev.ymlvsdocker-compose.yml)Configuration Options
# Usage examples ./scripts/dev-setup/populate-ckan.sh --env dev ./scripts/dev-setup/populate-ckan.sh --env prod --users-only ./scripts/dev-setup/populate-ckan.sh --cleanupAPI Token Management
Acceptance Criteria
Files Referenced
docs/test-potree-permissions.md- Contains the manual commands to automateCLAUDE.md- Docker commands and environment setup.env.dev.config/.env.prod.config- Environment configurationBenefits