[Feature] Ability to assign user to role with model & id + cache improvements#186
[Feature] Ability to assign user to role with model & id + cache improvements#186konovalov-nk wants to merge 1 commit intokodeine:1.0from
Conversation
- Added cache reset after assignRole/revokeRole - getRoles and getPermissions behavior changed to see actual role and permission mappings - Integration Tests to cover new features
|
This is awesome and the reasons why I'm looking into this package anyway. Do you think it would be an idea/possibility to make the user_role pivot table such that we can use Many To Many Polymorphic Relations? I think the current setup is almost there already, except for the db-table column naming. This would allow people to easily retrieve all the models on which a user has a certain role. |
|
@mtveerman I think that is actually possible but I'm not sure how Many to Many Polymorphic Relations actually work. An example how it would work with this package would be really helpful 👍 "require": {
"konovalov-nk/laravel-acl": "~1.0@dev",
},
"repositories": [
{
"url": "https://github.com/konovalov-nk/laravel-acl.git",
"type": "git"
}
],
|
|
@konovalov-nk is it backwards compatible because i see u merged this into 1.0, based on #181 i think we had to merge this into master and then release version 2 right? |
|
@kodeine It breaks compatibility with 1.0 so it's more like version 2.0; yes, that is intended for version 2.0 release. |
|
@konovalov-nk can you PR this for master branch so we can merge it with master for v2? |
|
@kodeine sure, I'll change it. |
I needed a simple feature that allows assigning user roles to models and model ids:
See this issue.
You can see how it basically works by reading through this integration test.