Cms: Ability to customize the user database table names

Created on 4 Mar 2020  Â·  4Comments  Â·  Source: statamic/cms

A pre-existing Laravel application using typical auth and with a role_user table already in place, breaks Statamic CP access with:

Symfony\Component\Debug\Exception\FatalThrowableError
Call to a member function permissions() on null

To work around the issue and gain access to the CP it is necessary to truncate the role_user table (with the obvious consequence that this renders either Statamic or the pre-existing application unusable).

It seems both applications don't yet enjoy sharing this table!

custom laravel

Most helpful comment

The real issue here is that we should make our table names configurable.

If you have your own existing role system and it just happens to have the same table names as what we use, I definitely wouldn't expect it to "just work".

Wherever we are hardcoding users, roles, role_user, etc, we should have a config for them.

All 4 comments

The real issue here is that we should make our table names configurable.

If you have your own existing role system and it just happens to have the same table names as what we use, I definitely wouldn't expect it to "just work".

Wherever we are hardcoding users, roles, role_user, etc, we should have a config for them.

In addition to the problem with conflicting roles, I don't think I like the idea of Statamic making the password column nullable and adding new columns to my pre-existing users table. I'd feel much more comfortable with configurable user tables.

The "file" option for Statamic's user repository seemed like a good alternative but the installation guide wants you to change the User Provider in config/auth. Correct me if I am wrong but this seems like it would cause issues of its own for any pre-existing apps? I've add a feature request for this: #https://github.com/statamic/ideas/issues/345

This issue has not had recent activity and has been marked as stale — by me, a robot. Simply reply to keep it open and send me away. If you do nothing, I will close it in a week. I have no feelings, so whatever you do is fine by me.

This issue has not had recent activity and has been marked as stale — by me, a robot. Simply reply to keep it open and send me away. If you do nothing, I will close it in a week. I have no feelings, so whatever you do is fine by me.

Please keep it open 😘

Was this page helpful?
0 / 5 - 0 ratings

Related issues

philippgrimm picture philippgrimm  Â·  3Comments

austenc picture austenc  Â·  3Comments

riasvdv picture riasvdv  Â·  4Comments

aerni picture aerni  Â·  3Comments

ReneWeCode picture ReneWeCode  Â·  3Comments