Instead of denying access to the fields on the edit page, I think it would be better to disable the edit page altogether. This would also hide the link on the user's profile page and prevent the user from clicking the link only to have nothing to edit.

CommentFileSizeAuthor
#1 use-menu-alter-1307514-1.patch1.91 KBBassistJimmyJam

Comments

BassistJimmyJam’s picture

StatusFileSize
new1.91 KB

The attached patch remove the use of hook_form_alter() and replaces it with hook_menu_alter() and an access callback. It also adds a missing @file docblock and corrects the permission's description.

BassistJimmyJam’s picture

Status: Active » Needs review
yaremchuk’s picture

Hi James,

I think your approach is reasonable.
I'll perform your patch and create new version of the module.

If you would like I can add you as a comaintainer of this module.

Thanks!

I'll update you.

Vasily

BassistJimmyJam’s picture

If you are seeking a co-maintainer I have no objections. This module is pretty simple and I can not imagine many support request but I am always happy to lend a hand.

yaremchuk’s picture

Hi James,
you were added to the co-maintainers.
I think it will be good if you will implement your patch and start new branch of the module,
say, 7.x-2.x
I think we should start new branch because the restriction of access by hook_menu_alter
is a slightly different approach.
So we should leave the ability to the other site builders to use current approch that restrict some fields editing only.

Thanks!
Sincerely yours,
Vasily Yaremchuk

BassistJimmyJam’s picture

Status: Needs review » Needs work

That sounds like a great idea, I'll take care of it this weekend.

BassistJimmyJam’s picture

Assigned: Unassigned » BassistJimmyJam
Status: Needs work » Fixed

Beta 1 of 7.x-2.0 has been released.

yaremchuk’s picture

James, thanks!

The 2.x branch was setted as recomended.
I think that this approach will be more in demand.

yaremchuk’s picture

Status: Fixed » Closed (fixed)