Skip to main content

Product Metadata, Resources, and Roles

1. tbl_master_products — Product table

Purpose / Introduction

tbl_master_products stores product-level metadata used by Aventian to manage provisioning and behavior for each supported product (e.g., cleversort). This is the canonical registry of products under the Aventian umbrella.

Key fields (ERD-derived)

  • id — product identifier (PK)
  • name — product code or key (e.g., cleversort)
  • base_url — product dashboard base URL (for redirects)
  • logo, display_name, brand_color — UI metadata
  • created_at, updated_at
  • allowed_resource_type_ids (list / reference) — resource types that product uses (optional)

Usability & relationships

  • tbl_master_products.id → referenced by tbl_master_resources.product_id, tbl_template_roles.product_id, tbl_roles.product_id, and tbl_team_product_assoc.product_id.
  • On product onboarding, Aventian reads provisioning script references from this table to perform DB creation & seeding.

Cleversort example

A tbl_master_products row for Cleversort:

idnamebase_urllogo
2Cleversorthttps://qa.v2.cleversort.comhttps://storage.googleapis.com/assets-aventian-qa/products/cleversort.svg

2. tbl_master_resources — Resource table

Purpose / Introduction

tbl_master_resources catalogs resource types / resource definitions exposed by a product. These are the objects on which privileges apply (e.g., project, task, board).

Key fields

  • id — resource identifier (PK)
  • name — human-friendly resource name (e.g., project, task)
  • product_id — FK to tbl_master_products (which product owns this resource)
  • parent_id — optional FK to another resource (for hierarchical resources)
  • resource_type_id — type classification (maps to tbl_master_resource_type)
  • is_active, icon_name, created_at, updated_at

Usability & relationships

  • tbl_master_privileges.resource_id references this table (privileges are associated to resources).
  • tbl_roles.resource_type_id or tbl_roles.product_id can reference resource type for scoping built-in or template roles.
  • Resources help organize privileges and UI exposure.

Resource type

  • Application resource: modules most commonly used within the application.
  • Project resource: resources used within the project module.
  • System resources: invisible resources handled by the application itself.
  • Hybrid resources: partly within the application and within the project.

Cleversort example resources

A tbl_master_resources rows for Cleversort:

idresource_nameproduct_nameparent_nameresource_type
5Team ManagementCleversortApplication
6Project ManagementCleversortProject
7Widget ManagementCleversortProject
8Task ManagementCleversortProject
10SettingsCleversortTeam ManagementApplication
11NotificationsCleversortTeam ManagementApplication
12ProjectsCleversortTeam ManagementApplication
13Projects HybridCleversortTeam ManagementHybrid
14Optional FieldsCleversortProject ManagementProject
15Custom FieldsCleversortProject ManagementProject
16MembersCleversortProject ManagementProject
17FoldersCleversortTeam ManagementApplication
18Optional FieldsCleversortWidget ManagementProject
19Custom FieldsCleversortWidget ManagementProject

3. tbl_master_privileges — Master privileges table

Purpose / Introduction

tbl_master_privileges defines the atomic actions that can be granted on a resource (e.g., create_project, edit_task, view_board, transfer_ownership).

Key fields

  • id — privilege id (PK)
  • name — human-friendly name
  • key — programmatic key (e.g., create_project)
  • description
  • resource_id — FK → tbl_master_resources.id
  • is_active, created_at, updated_at

Usability & relationships

  • Privileges are associated to roles via tbl_role_privilege_assoc and to template roles via tbl_template_role_privilege_assoc.
  • tbl_user_direct_privilege allows assigning privilege directly to a user (bypassing role), optionally per team_id.

Cleversort example privileges

Some Cleversort privileges:

idnamekeydescriptionresource_type
37Create New Custom Fieldsproject:customfields:createAdd new custom fieldsCustom Fields
38Edit Custom Fieldsproject:customfields:editModify custom fieldsCustom Fields
39Delete Custom Fieldsproject:customfields:deleteRemove custom fieldsCustom Fields
49Add Custom Fieldswidget:customfields:addAdd new custom fields to widgetCustom Fields
50Edit Custom Fieldswidget:customfields:editEdit custom fields of widgetCustom Fields
51Delete Custom Fieldswidget:customfields:deleteDelete custom fields of the widgetCustom Fields
41Manage Foldersproject:folder:manageFull control over all folder operations in a projectFolders
40Manage Project Membersproject:member:manageAdd or remove membersMembers
26Team Notification (user specific)team:notification:manageTo control project activity such as overdue task notificationNotifications
36Optional Fieldsproject:optionalfields:editModify optional project fieldsOptional Fields
48Optional Fieldswidget:optionalfields:editModify optional widget-level fieldsOptional Fields
30View Projectproject:viewView project detailsProject Management
31Edit project metadataproject:editEdit project titleProject Management
32Archive projectproject:archiveArchive the projectProject Management
33Clone Projectproject:cloneDuplicate a projectProject Management
27Projectsteam:all:projectsList all projects and abitity to associate with the projectProjects
29Create Projectteam:project:createCreate a new projectProjects
34Project colorproject:color:ownSet a color for the projectProjects
35Favorite Projectproject:favourite:ownMake a project favourite/unfavouriteProjects
28Projectsteam:project:restrictedProjects Hybrid
21View Settingsteam:settings:viewView all the settings of organizationSettings
22Edit optional fieldsteam:settings:optionalfields:editModify oganization level optional fieldsSettings
23Create Custom fieldsteam:settings:customfields:createadd custom fields for organizationSettings
24Edit Custom Fieldsteam:settings:customfields:editUpdate custom field configurationsSettings
25Delete Custom Fieldsteam:settings:customfields:deleteRemove organization custom fieldsSettings
53View Tasktask:viewView all tasksTask Management
54Add Tasktask:addCreate a new taskTask Management
55Add Stagestage:addAdd a new stageTask Management
56Edit Tasktask:editUpdate task detailsTask Management
57Edit Stagestage:editUpdate stage detailsTask Management
58Edit Blockblock:editUpdate Block detailsTask Management
59Delete Tasktask:deleteRemove a taskTask Management
60Delete Stagestage:deleteRemove a stageTask Management
42View widgetwidget:viewView widget within a projectWidget Management
43Create new widgetwidget:createAdd a new widgetWidget Management
44Update widgetwidget:editEdit widget detailsWidget Management
45Rearrange widgetwidget:moveMove widget positionsWidget Management
46Delete widgetwidget:deleteRemove a widgetWidget Management
47Clone widgetwidget:cloneDuplicate a widgetWidget Management
52Make widget Privatewidget:privateRestrict widget visibilityWidget Management

4. tbl_roles — Built-in and Invisible System Roles

tbl_roles stores role definitions. Roles can be:

  • Built-in (product-specific): preset roles with a fixed privileges set, visible in UI for assignment (but not editable).
  • Invisible system roles: special roles not shown in UI and assigned by system logic (e.g., team owner gets Ownership Role).
  • Custom roles: created by users (not covered here — product and team-specific).

Key fields (ERD)

  • id — role id (PK)
  • name — role name (e.g., Administrator, Member)
  • description — explanation; invisible roles may have description invisible system role
  • team_id — nullable; built-in/invisible roles have NULL team_id (global for product)
  • product_id — FK → tbl_master_products (scopes role to product)
  • resource_type_id — scope indicator
  • is_visible — if false, not listed in UI (used for invisible roles)
  • created_by, created_at, updated_by, updated_at

Built-in role characteristics

  • description indicates Built-in-role
  • team_id = NULL
  • Pre-wired to a fixed set of privileges through tbl_role_privilege_assoc
  • UI shows these roles but users cannot edit the role privilege set

Invisible system role characteristics

  • description indicates invisible system role
  • team_id = NULL
  • is_visible = false (or similar flag)
  • System logic assigns them to users (e.g., assign Ownership Role to team owner)
  • Still wired to privileges via tbl_role_privilege_assoc

Relational associations

  • Role ↔ Privilege: Many-to-many via tbl_role_privilege_assoc (role_id, privilege_id)
  • Role ↔ User: Many-to-many via tbl_user_role_assoc (user_id, role_id, team_id) (note team_id set for per-team assignments)

Cleversort example privileges

idnamedescriptionproduct_nameresource_type
3AdminBuilt-in RoleCleversortApplication
2MemberBuilt-in RoleAventianApplication
1AdministratorBuilt-in RoleAventianApplication
5CollaboratorBuilt-in RoleCleversortHybrid
4Project AdminBuilt-in RoleCleversortProject
23Team OwnerInvisible system roleAventiansystem

5. tbl_template_roles — Template roles

Purpose

Template roles are product-scoped role blueprints. They define a set of privileges which are not directly assignable to users; instead, editing a template produces a custom role instantiated for a team.

Key fields

  • id — template role id
  • name, description
  • product_id — FK to tbl_master_products
  • resource_type_id
  • created_by, created_at, updated_by, updated_at

Privilege association

  • tbl_template_role_privilege_assoc (role_id, privilege_id) links template roles to privileges.

Behavior

  • Template roles provide a reusable starting point.
  • When a user edits or instantiates a template role for a team, a new tbl_roles record (custom role) is created with the template’s privileges copied.

Cleversort example privileges

idnamedescriptionproduct_nameresource_type
-1MemberCleversort Team MemberCleversortApplication
-3EditorAventian EditorAventianApplication
-2EditorCleversort Project EditorCleversortProject

6. Integration Checklist (Actionable)

Use this checklist to onboard Cleversort or similar product:

  • Product registration & metadata

    • Add product to tbl_master_products with id, name, base_url, etc.
    • Register allowed resource types (if used) and link to product.
  • Resources & privileges

    • Insert product resources into tbl_master_resources (projects, tasks, boards, etc.).
    • Insert master privileges into tbl_master_privileges and link to resources.
  • Roles & templates

    • Create built-in roles in tbl_roles (product-level, team_id = NULL) and associate privileges via tbl_role_privilege_assoc.
    • Create invisible system role(s) in tbl_roles with resource_type_id = 4 and associate privileges.
    • Create template roles in tbl_template_roles and associate privileges via tbl_template_role_privilege_assoc.