Add a permission to disable the user picture upload form
Dave Reid - May 16, 2009 - 16:45
| Project: | Gravatar integration |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Dave Reid |
| Status: | active |
Jump to:
Description
From #334609: Users should still be able to upload a user picture and override Gravatar and #447130: Avatar priority? there have been feature requests to be able to disable the picture upload form. The best way to do this would to add a 'disable picture upload' permission. I prefer using a negative permission rather than a positive permission like ('user picture upload') since users should be able to use this by default, as that is the current behavior in core.

#1
I've never seen a negative permission on drupal before, but I'm not sure if this is common in other modules. Personally, I don't like the idea of that.
So I'd rather vote for a 'user picture upload' permission or an additioal option on the gravatar configuration page.
#2
I agree this should not be a negative permission, especially considering the apply-all approach in the admin role menu (and it's D7 core feature).
#3
What is the status on this feature request?
In the mean time you can prevent users from uploading a picture and overriding the avatar by following these two steps.
1. Change the maximum file size for an avatar to .01 kb.
2. Add the following to your theme
#edit-picture-upload-wrapper {display:none;}#4
Plan to move forward on this is to marge the 'can disable own gravatar' permission into a 'change own user picture' permission that will be enabled for registered users by default (since that's the out-of-the-box functionality for core). If this permission is disabled but the user has the 'use gravatar' permission, they can no longer use the upload form and are forced to use gravatars.