myth-auth
myth-auth copied to clipboard
Inconsistent Models
Model use throughout the library is inconsistent, src/Config/Services.php being a central discrepancy:
50 Parameter #1 $groupModel of class Myth\Auth\Authorization\FlatAuthorization constructor expects Myth\Auth\Authorization\GroupModel, CodeIgniter\Model given.
50 Parameter #2 $permissionModel of class Myth\Auth\Authorization\FlatAuthorization constructor expects Myth\Auth\Authorization\PermissionModel, CodeIgniter\Model given.
52 Parameter #1 $model of method Myth\Auth\Authorization\FlatAuthorization::setUserModel() expects Myth\Auth\Models\UserModel, CodeIgniter\Model given.
This library should decide one of two ways:
- Support any Model class, and either loosen class methods or add interfaces for required methods
- Require specific models (like
GroupModel
) and developers can extend those models if they need to
And it would be concise if we move GroupModel and PermissionModel inside Authorization folder to the respective Models folder. What do you think about it ?
Yes, I lobbied for this on Shield and we went with that. It's a pain always having to remember which Models folder to go looking for 😱