{"action":"created","comment":{"url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/pulls/comments/67729441","id":67729441,"diff_hunk":"@@ -80,31 +83,55 @@ public class HH_Container_LCTRL {\n         try {\n             if (hhId == null)\n                 return null;\n-            string strSoql;\n-            if (UTIL_Describe.isObjectIdThisType(hhId, 'Account')) {\n-                strSoql = 'select Id, Name, npo02__SYSTEM_CUSTOM_NAMING__c, npo02__Formal_Greeting__c, npo02__Informal_Greeting__c, ' +\n-                        UTIL_Namespace.StrTokenNSPrefix('Number_of_Household_Members__c') + ', ' +\n-                        'BillingStreet, BillingCity, BillingState, BillingPostalCode, BillingCountry, BillingLatitude, BillingLongitude';\n-\n-                /*** until we support these, we don't want them to interfere with what the user specifies.\n-                if (ADDR_Addresses_TDTM.isStateCountryPicklistsEnabled)\n-                    strSoql += ', BillingCountryCode, BillingStateCode ';\n-                ****/\n-\n-                strSoql += ' from Account where Id = :hhId';\n-            } else {\n-                strSoql = 'select Id, Name, npo02__SYSTEM_CUSTOM_NAMING__c, npo02__Formal_Greeting__c, npo02__Informal_Greeting__c, ' +\n-                        UTIL_Namespace.StrTokenNSPrefix('Number_of_Household_Members__c') + ', ' +\n-                        'npo02__MailingStreet__c, npo02__MailingCity__c, npo02__MailingState__c, npo02__MailingPostalCode__c, npo02__MailingCountry__c ' +\n-                        ' from npo02__Household__c where Id = :hhId';\n+            \n+            string strSoql = 'select Id, ';\n+            String strComma = '';\n+            Boolean isHHAccount = UTIL_Describe.isObjectIdThisType(hhId, 'Account');\n+            list<String> listStrFld = getUpdateableHouseholdFields(isHHAccount);\n+            String strObject = isHHAccount ? 'Account' : 'npo02__Household__c';\n+            \n+\t\t\t// check field level security and construct our soql            \n+            for (String strF : listStrFld) {\n+                DescribeFieldResult dfr = UTIL_Describe.getFieldDescribe(strObject, strF);\n+                if (dfr == null || !dfr.isAccessible() || !dfr.isUpdateable())\n+                    throw (new permsException(string.format(label.flsError, new string[]{strObject + '.' + strF})));\n+                \n+                strSoql += strComma + strF;\n+                strComma = ',';\n             }\n+            \n+            strSoql += ' from ' + strObject + ' where Id = :hhId';","path":"src/classes/HH_Container_LCTRL.cls","position":60,"original_position":60,"commit_id":"e6ce01fe6d817b15bdf269ddb2d346114819e019","original_commit_id":"3b74ddfafd832eff192cf3bff695d48949bfa66d","user":{"login":"davidhabib","id":908119,"avatar_url":"https://avatars.githubusercontent.com/u/908119?v=3","gravatar_id":"","url":"https://api.github.com/users/davidhabib","html_url":"https://github.com/davidhabib","followers_url":"https://api.github.com/users/davidhabib/followers","following_url":"https://api.github.com/users/davidhabib/following{/other_user}","gists_url":"https://api.github.com/users/davidhabib/gists{/gist_id}","starred_url":"https://api.github.com/users/davidhabib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidhabib/subscriptions","organizations_url":"https://api.github.com/users/davidhabib/orgs","repos_url":"https://api.github.com/users/davidhabib/repos","events_url":"https://api.github.com/users/davidhabib/events{/privacy}","received_events_url":"https://api.github.com/users/davidhabib/received_events","type":"User","site_admin":false},"body":"checking fields is enough.  if the object permissions aren't allowed, then any field check will also fail.","created_at":"2016-06-20T17:21:59Z","updated_at":"2016-06-20T17:21:59Z","html_url":"https://github.com/SalesforceFoundation/Cumulus/pull/2112#discussion_r67729441","pull_request_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/pulls/2112","_links":{"self":{"href":"https://api.github.com/repos/SalesforceFoundation/Cumulus/pulls/comments/67729441"},"html":{"href":"https://github.com/SalesforceFoundation/Cumulus/pull/2112#discussion_r67729441"},"pull_request":{"href":"https://api.github.com/repos/SalesforceFoundation/Cumulus/pulls/2112"}}},"pull_request":{"url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/pulls/2112","id":73271673,"html_url":"https://github.com/SalesforceFoundation/Cumulus/pull/2112","diff_url":"https://github.com/SalesforceFoundation/Cumulus/pull/2112.diff","patch_url":"https://github.com/SalesforceFoundation/Cumulus/pull/2112.patch","issue_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/issues/2112","number":2112,"state":"open","locked":false,"title":"Feature/lex manage household","user":{"login":"davidhabib","id":908119,"avatar_url":"https://avatars.githubusercontent.com/u/908119?v=3","gravatar_id":"","url":"https://api.github.com/users/davidhabib","html_url":"https://github.com/davidhabib","followers_url":"https://api.github.com/users/davidhabib/followers","following_url":"https://api.github.com/users/davidhabib/following{/other_user}","gists_url":"https://api.github.com/users/davidhabib/gists{/gist_id}","starred_url":"https://api.github.com/users/davidhabib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidhabib/subscriptions","organizations_url":"https://api.github.com/users/davidhabib/orgs","repos_url":"https://api.github.com/users/davidhabib/repos","events_url":"https://api.github.com/users/davidhabib/events{/privacy}","received_events_url":"https://api.github.com/users/davidhabib/received_events","type":"User","site_admin":false},"body":"@dospromptman this pull request adds apex tests for all apex code used in the Manage Household UI lightning implementation.","created_at":"2016-06-09T19:29:00Z","updated_at":"2016-06-20T17:21:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8ac9ac12ac5efecf23a675210eb5edc170f24ff4","assignee":{"login":"dospromptman","id":1058323,"avatar_url":"https://avatars.githubusercontent.com/u/1058323?v=3","gravatar_id":"","url":"https://api.github.com/users/dospromptman","html_url":"https://github.com/dospromptman","followers_url":"https://api.github.com/users/dospromptman/followers","following_url":"https://api.github.com/users/dospromptman/following{/other_user}","gists_url":"https://api.github.com/users/dospromptman/gists{/gist_id}","starred_url":"https://api.github.com/users/dospromptman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dospromptman/subscriptions","organizations_url":"https://api.github.com/users/dospromptman/orgs","repos_url":"https://api.github.com/users/dospromptman/repos","events_url":"https://api.github.com/users/dospromptman/events{/privacy}","received_events_url":"https://api.github.com/users/dospromptman/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/pulls/2112/commits","review_comments_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/pulls/2112/comments","review_comment_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/issues/2112/comments","statuses_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/statuses/e6ce01fe6d817b15bdf269ddb2d346114819e019","head":{"label":"SalesforceFoundation:feature/lex-manage-household","ref":"feature/lex-manage-household","sha":"e6ce01fe6d817b15bdf269ddb2d346114819e019","user":{"login":"SalesforceFoundation","id":972305,"avatar_url":"https://avatars.githubusercontent.com/u/972305?v=3","gravatar_id":"","url":"https://api.github.com/users/SalesforceFoundation","html_url":"https://github.com/SalesforceFoundation","followers_url":"https://api.github.com/users/SalesforceFoundation/followers","following_url":"https://api.github.com/users/SalesforceFoundation/following{/other_user}","gists_url":"https://api.github.com/users/SalesforceFoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/SalesforceFoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SalesforceFoundation/subscriptions","organizations_url":"https://api.github.com/users/SalesforceFoundation/orgs","repos_url":"https://api.github.com/users/SalesforceFoundation/repos","events_url":"https://api.github.com/users/SalesforceFoundation/events{/privacy}","received_events_url":"https://api.github.com/users/SalesforceFoundation/received_events","type":"Organization","site_admin":false},"repo":{"id":13108586,"name":"Cumulus","full_name":"SalesforceFoundation/Cumulus","owner":{"login":"SalesforceFoundation","id":972305,"avatar_url":"https://avatars.githubusercontent.com/u/972305?v=3","gravatar_id":"","url":"https://api.github.com/users/SalesforceFoundation","html_url":"https://github.com/SalesforceFoundation","followers_url":"https://api.github.com/users/SalesforceFoundation/followers","following_url":"https://api.github.com/users/SalesforceFoundation/following{/other_user}","gists_url":"https://api.github.com/users/SalesforceFoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/SalesforceFoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SalesforceFoundation/subscriptions","organizations_url":"https://api.github.com/users/SalesforceFoundation/orgs","repos_url":"https://api.github.com/users/SalesforceFoundation/repos","events_url":"https://api.github.com/users/SalesforceFoundation/events{/privacy}","received_events_url":"https://api.github.com/users/SalesforceFoundation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SalesforceFoundation/Cumulus","description":"The current version of the Salesforce.org Nonprofit Starter Pack","fork":false,"url":"https://api.github.com/repos/SalesforceFoundation/Cumulus","forks_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/forks","keys_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/teams","hooks_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/hooks","issue_events_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/issues/events{/number}","events_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/events","assignees_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/assignees{/user}","branches_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/branches{/branch}","tags_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/tags","blobs_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/git/refs{/sha}","trees_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/statuses/{sha}","languages_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/languages","stargazers_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/stargazers","contributors_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/contributors","subscribers_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/subscribers","subscription_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/subscription","commits_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/commits{/sha}","git_commits_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/git/commits{/sha}","comments_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/comments{/number}","issue_comment_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/issues/comments{/number}","contents_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/contents/{+path}","compare_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/merges","archive_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/downloads","issues_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/issues{/number}","pulls_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/pulls{/number}","milestones_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/milestones{/number}","notifications_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/labels{/name}","releases_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/releases{/id}","deployments_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/deployments","created_at":"2013-09-25T23:56:49Z","updated_at":"2016-06-10T16:50:51Z","pushed_at":"2016-06-20T17:20:41Z","git_url":"git://github.com/SalesforceFoundation/Cumulus.git","ssh_url":"git@github.com:SalesforceFoundation/Cumulus.git","clone_url":"https://github.com/SalesforceFoundation/Cumulus.git","svn_url":"https://github.com/SalesforceFoundation/Cumulus","homepage":"http://www.salesforce.org/help/nonprofitstarterpack","size":59916,"stargazers_count":119,"watchers_count":119,"language":"Apex","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":109,"mirror_url":null,"open_issues_count":266,"forks":109,"open_issues":266,"watchers":119,"default_branch":"dev"}},"base":{"label":"SalesforceFoundation:feature/lex-manage-household-REVIEWED","ref":"feature/lex-manage-household-REVIEWED","sha":"971d29b46a4975df79b4339e56225c881808675c","user":{"login":"SalesforceFoundation","id":972305,"avatar_url":"https://avatars.githubusercontent.com/u/972305?v=3","gravatar_id":"","url":"https://api.github.com/users/SalesforceFoundation","html_url":"https://github.com/SalesforceFoundation","followers_url":"https://api.github.com/users/SalesforceFoundation/followers","following_url":"https://api.github.com/users/SalesforceFoundation/following{/other_user}","gists_url":"https://api.github.com/users/SalesforceFoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/SalesforceFoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SalesforceFoundation/subscriptions","organizations_url":"https://api.github.com/users/SalesforceFoundation/orgs","repos_url":"https://api.github.com/users/SalesforceFoundation/repos","events_url":"https://api.github.com/users/SalesforceFoundation/events{/privacy}","received_events_url":"https://api.github.com/users/SalesforceFoundation/received_events","type":"Organization","site_admin":false},"repo":{"id":13108586,"name":"Cumulus","full_name":"SalesforceFoundation/Cumulus","owner":{"login":"SalesforceFoundation","id":972305,"avatar_url":"https://avatars.githubusercontent.com/u/972305?v=3","gravatar_id":"","url":"https://api.github.com/users/SalesforceFoundation","html_url":"https://github.com/SalesforceFoundation","followers_url":"https://api.github.com/users/SalesforceFoundation/followers","following_url":"https://api.github.com/users/SalesforceFoundation/following{/other_user}","gists_url":"https://api.github.com/users/SalesforceFoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/SalesforceFoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SalesforceFoundation/subscriptions","organizations_url":"https://api.github.com/users/SalesforceFoundation/orgs","repos_url":"https://api.github.com/users/SalesforceFoundation/repos","events_url":"https://api.github.com/users/SalesforceFoundation/events{/privacy}","received_events_url":"https://api.github.com/users/SalesforceFoundation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SalesforceFoundation/Cumulus","description":"The current version of the Salesforce.org Nonprofit Starter Pack","fork":false,"url":"https://api.github.com/repos/SalesforceFoundation/Cumulus","forks_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/forks","keys_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/teams","hooks_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/hooks","issue_events_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/issues/events{/number}","events_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/events","assignees_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/assignees{/user}","branches_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/branches{/branch}","tags_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/tags","blobs_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/git/refs{/sha}","trees_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/statuses/{sha}","languages_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/languages","stargazers_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/stargazers","contributors_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/contributors","subscribers_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/subscribers","subscription_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/subscription","commits_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/commits{/sha}","git_commits_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/git/commits{/sha}","comments_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/comments{/number}","issue_comment_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/issues/comments{/number}","contents_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/contents/{+path}","compare_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/merges","archive_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/downloads","issues_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/issues{/number}","pulls_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/pulls{/number}","milestones_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/milestones{/number}","notifications_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/labels{/name}","releases_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/releases{/id}","deployments_url":"https://api.github.com/repos/SalesforceFoundation/Cumulus/deployments","created_at":"2013-09-25T23:56:49Z","updated_at":"2016-06-10T16:50:51Z","pushed_at":"2016-06-20T17:20:41Z","git_url":"git://github.com/SalesforceFoundation/Cumulus.git","ssh_url":"git@github.com:SalesforceFoundation/Cumulus.git","clone_url":"https://github.com/SalesforceFoundation/Cumulus.git","svn_url":"https://github.com/SalesforceFoundation/Cumulus","homepage":"http://www.salesforce.org/help/nonprofitstarterpack","size":59916,"stargazers_count":119,"watchers_count":119,"language":"Apex","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":109,"mirror_url":null,"open_issues_count":266,"forks":109,"open_issues":266,"watchers":119,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/SalesforceFoundation/Cumulus/pulls/2112"},"html":{"href":"https://github.com/SalesforceFoundation/Cumulus/pull/2112"},"issue":{"href":"https://api.github.com/repos/SalesforceFoundation/Cumulus/issues/2112"},"comments":{"href":"https://api.github.com/repos/SalesforceFoundation/Cumulus/issues/2112/comments"},"review_comments":{"href":"https://api.github.com/repos/SalesforceFoundation/Cumulus/pulls/2112/comments"},"review_comment":{"href":"https://api.github.com/repos/SalesforceFoundation/Cumulus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SalesforceFoundation/Cumulus/pulls/2112/commits"},"statuses":{"href":"https://api.github.com/repos/SalesforceFoundation/Cumulus/statuses/e6ce01fe6d817b15bdf269ddb2d346114819e019"}}}}
{"actor":{"display_login":"davidhabib"}}