This project can be used to implement Admin Panel with multiple admin users having different levels of accessibility and authority. You can dynamically manage users access to tabs and actions e.g.(CRUD operations).
2.4.1
5.1.4
- Active Admin gem is setup
- Devise gem is setup
- Now, you have active admin up & running. you can see admin_user model crated by active admin. you can have multiple models linked with active admin. now let's move to the real work.
- Create a model named "Tab" to store name of tabs appearing in active admin.
- Create a middle model between AdminUser and Tab.
- Add a column for defining accessibility between users & tabs (allowed_actions: "Read/Write")
- AdminUser has many AdminUserTabs(Middle table name)
- AdminUser has many Tabs through AdminUserTabs
- Tab can have many AdminUserTabs
- Tab can have many AdminUsers through AdminUserTabs
- Model Name: (User => "User")
- Model Name: (Admin User => "AdminUser")
- Run Seed file to setup dummy data
- Change Tab names according to your tabs considering format described above.
-
app/model/admin_user.rb
-
app/helpers/admin_helper.rb
-
...