Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed by user column in ab_user table is not updated when user logged in through LDAP #2228

Open
aravindan06 opened this issue Apr 12, 2024 · 2 comments

Comments

@aravindan06
Copy link

aravindan06 commented Apr 12, 2024

If you'd like to report a bug in Flask-Appbuilder, fill out the template below. Provide
any extra information that may be useful

Responsible disclosure:
We want to keep Flask-AppBuilder safe for everyone. If you've discovered a security vulnerability
please report to [email protected].

Environment

Flask-Appbuilder version: 4.3.1

pip freeze output: No errors

We have the user details present in ab_user table and for example if user 'X' updates any role of user 'Y', User 'X’ id should be captured in changed_by_fk column in ab_user table. But it is not happening and value is always null. But this case is working when we authenticate simply via database instead of LDAP.

Tell us what should happen.

We would need to understand why changed_by_fk column is not getting updated. We can see this column gets updated in flask-appbuilder/security/models.py file but its not working through LDAP auth.

@aravindan06
Copy link
Author

Hello, can someone help with this please?

@Yoyasp
Copy link
Contributor

Yoyasp commented May 13, 2024

Are you changing properties of the role (as in changing which permissions are assigned to a role) or changing which roles are assigned to a specific user?

As far as i know the changed_by_fk column is only updated when attributes of user are changed (email, name, password etc...).
There is a different table that tracks the roles that are assigned to the users. assoc_user_role in flask_appbuilder/security/sqla/models.py.

Im not sure why this table does not have a column on who changed it last, but reading the code this is not a bug.
If you want to be able to track changes in role assignment you should create a new feature request where we can discuss the details on how/why to implement this.

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

No branches or pull requests

2 participants