Service Startup
Service Startup executes logic when the application starts. Service Startup classes are automatically discovered and executed by the framework.
Create Service Startup
Create a new file in the project in the Logic or Startup folder.
Project / Startup / RoleStartup.cs
The ServiceStartup attribute takes the following parameters:
- StartupOperation: 
Preexecutes before system records are created,Postexecutes after (usePostunless you needPre) - Order (optional): Execution order when multiple startup services run at the same stage (lower executes first, default: 0)
 
Initialize Roles, Permissions and Options
Use the SecurityBuilder to initialize roles and assign permissions. Roles are created if they don't exist. Permissions must already exist (automatically created by the framework for entities, actions, jobs and hubs).
Project / Startup / RoleStartup.cs
Permissions follow these naming conventions:
- Table: 
TABLE_(TableName)_(Operation)_(Level)- Example:TABLE_Widget_READ_SYSTEM,TABLE_Account_UPDATE_TEAM - Action: 
ACTION_(ActionName)- Example:ACTION_SendNotification,ACTION_ExportData - Hub: 
HUB_(HubName)- Example:HUB_ChatHub,HUB_AdminHub - Job: 
JOB_(JobName)- Example:JOB_DataCleanup 
See the Security documentation for more details.
Dependency Injection
Service Startup classes support constructor-based dependency injection: