Non-admin users cannot edit own profile (production)
Bug #788479 reported by
Matt Giuca
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MUGLE |
Fix Released
|
High
|
Matt Giuca |
Bug Description
Non-admin users have userCanEdit set to false (can't see the edit button or access the edit page) for their own User objects. This is not a problem for devteams or games, only users. It only shows up on the production server; the testing server (including the gwtc compiled code) does not exhibit this problem.
Related branches
Changed in mugle: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Wow, we're a bit screwed here. The problem is this: new Long(4) == new Long(4) is false.
Because all of our primary keys in the client classes are Longs, not longs, comparing them with == is doing a reference check to see whether the Long container is equal to the other Long container. Somehow, this works on the dev mode, but it doesn't on production.
In this particular case, the offending line is in UserServiceImpl .getByName, line 57: getPrimaryKey( ) == ud.getPrimaryKey()) ?
ClientView .PRIVATE : ClientView.PUBLIC;
ClientView cv = (curUser.
That needs to be getPrimaryKey( ).equals( ud.getPrimaryKe y())) ?
ClientView .PRIVATE : ClientView.PUBLIC;
ClientView cv = (curUser.
That fixes this particular problem on production, but who knows what else is buggy because of these sort of comparisons. (Basically all permissions are checked using ==.)