Client and server side field value checking

Gervase Markham gerv at mozilla.org
Wed Mar 9 12:43:08 UTC 2011


Summary: Are there any plans or bugs about having client-side field 
checks which match the server-side checks, perhaps autogenerated from a 
common source?

Details: say I want to customize my Bugzilla so that only people in a 
particular group can change a certain field to a certain value. I hack 
check_can_change_field() and Bugzilla enforces this - great. But it 
would be nice if the user was warned before they got as far as 
submitting the bug.

If it's a case of just "can change the field at all" or "can't change 
the field at all", then you can change the template so the field is 
disabled or not, as the case may be. But it rapidly gets more 
complicated if you want to say "Only people in group X can set 
resolution FOO".

At the moment, one would need to do this by reimplementing the 
check_can_change_field checks in Javascript. But that's more work, and 
there's a risk of them getting out of sync. Has anyone any ideas about 
how to make this less painful? I thought briefly about some sort of 
structured language and a Perl generator and a JS generator, or perhaps 
a Perl-to-JS autotranslator...

Or is it just one of those things one has to accept and deal with?

Gerv
_______________________________________________
dev-apps-bugzilla mailing list
dev-apps-bugzilla at lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-apps-bugzilla



More information about the developers mailing list