Skip to content

Commit

Permalink
Add Migrations for Role and Permission Set management
Browse files Browse the repository at this point in the history
This commit introduces database schema changes to extend the role and
permission management capabilities of Solidus.
These changes are derived from the solidus_user_roles gem and are
designed to provide more granular control over user roles and permissions.

Changes include:
  * Create Spree Permission Sets:
      Introduced a new Spree::PermissionSet table in the database.
      This table will store sets of permissions, each with a name and set
      identifier, that can be assigned to user roles.

  * Create Spree Roles Permissions:
      Introduced a new Spree::RolePermission table in the database.
      This table will store the associations between roles and permission sets.
      It includes foreign key references to the Spree::Role and
      Spree::PermissionSet tables.
  • Loading branch information
rainerdema authored and the-krg committed Aug 22, 2023
1 parent d095e38 commit 1f91fc8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/db/migrate/20230607100048_create_spree_permission_sets.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

class CreateSpreePermissionSets < ActiveRecord::Migration[7.0]
def change
create_table :spree_permission_sets do |t|
t.string :name
t.string :set
t.timestamps
end
end
end
11 changes: 11 additions & 0 deletions core/db/migrate/20230607100109_create_spree_roles_permissions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

class CreateSpreeRolesPermissions < ActiveRecord::Migration[7.0]
def change
create_table :spree_role_permissions do |t|
t.references :role
t.references :permission_set
t.timestamps
end
end
end

0 comments on commit 1f91fc8

Please sign in to comment.