Skip to content

Add Role resource 💛#5

Open
betoharres wants to merge 14 commits into
fator7:masterfrom
betoharres:role
Open

Add Role resource 💛#5
betoharres wants to merge 14 commits into
fator7:masterfrom
betoharres:role

Conversation

@betoharres

Copy link
Copy Markdown
Contributor

User (n) x (n) Role , where Credential is the sum of a User having a Role and being related to a Company
Role have a json field called permissions where will contain the schema that the authorization classes will based if user can or cannot do certain action using pundit gem(WIP).

After User register, he will be able to create a Company, in the creation of the company rails will create 2 Roles: Administrator and Guest, these 2 names will be reserved and are unique along with it's company_id.

Then after all this is done, after @company.save, rails will create UserCompany record to bound the User relationship with the just created Company.

When that's done, UserCompany will run it's callback assign_credentials to create Credentials, which, as described above, is the final bound to refer the User's role inside a tenant.

Test are green, but there're some pending tests that should be included in the Credential and Role model specs, which turns our heart to 💛 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant