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

[ADD] Added module password_change_restrict. #249

Conversation

alejandrosantana
Copy link

This module allow only admin and users within Access Rights to change passwords, disallowing the rest.

This module allow only admin and users within Access Rights to change passwords, disallowing the rest.
@moylop260
Copy link
Contributor

Is posible add unitest?

@dreispt
Copy link
Sponsor Member

dreispt commented Sep 8, 2015

The module name should begin with auth_.

class ResUsers(models.Model):
_inherit = 'res.users'

SELF_WRITEABLE_FIELDS = ['signature', 'action_id', 'company_id', 'email',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't do this, remove the field in _register_hook - otherwise we loose all changes from other modules in the inheritance chain

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In _register_hook or __init__? (I see other examples expanding SELF_WRITEABLE_FIELDS in __init__)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that shouldn't matter too much in this case. Generally, _register_hook is safer because your model is fully loaded (relevant if you need to look up stuff in the db, patch fields, etc)

@hbrunn hbrunn added this to the 8.0 milestone Sep 8, 2015
@alejandrosantana
Copy link
Author

@moylop260 As soon as I fixed @hbrunn recommendations, I will try to do tests.
@dreispt Agreed, I am changing it.
Regarding the other module, I think there are two functionalities there that should be separated. I could do a backport of this one to v7 if needed (but may take a delay) once this one is OK.

StefanRijnhart pushed a commit to StefanRijnhart/server-tools that referenced this pull request Feb 26, 2017
StefanRijnhart pushed a commit to StefanRijnhart/server-tools that referenced this pull request Feb 26, 2017
@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Oct 24, 2021
@github-actions github-actions bot closed this Nov 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs fixing needs review stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants