You need to sign in to do that
Don't have an account?
jaw999
I have a private feature VF page on an Account. Our Account sharing model is Public Read with Edit rights given via Account Teams.
I want to display this VF page only to:
- Account Team Members
- 'Global Access People' defined on their User record
- Anyone else with Edit access, using UserRecordAccess
My latest attemp fails, does not return true for me as someone who has Edit access-
Right now, no queries even fire when I load the page with this:
Also, I can't get a system.debug to compile in the class.
Team and Other Criteria defined access to VF Page - UserRecordAccess
I have a private feature VF page on an Account. Our Account sharing model is Public Read with Edit rights given via Account Teams.
I want to display this VF page only to:
- Account Team Members
- 'Global Access People' defined on their User record
- Anyone else with Edit access, using UserRecordAccess
My latest attemp fails, does not return true for me as someone who has Edit access-
public class AccountUserRecordAccessChecker2{ public ApexPages.StandardController sc; public AccountUserRecordAccessChecker2(ApexPages.StandardController sc) { this.sc = sc; } public boolean renderELEMENT(){ if ([select count() from User where Id = :UserInfo.getUserId() and Admin_Team__c = true] > 0) { return true; } if ([select count() from AccountTeamMember where UserId = :UserInfo.getUserId() and AccountId = :sc.getId()] > 0) { return true; } if([ SELECT MaxAccessLevel, RecordId FROM UserRecordAccess WHERE UserId = :UserInfo.getUserId() AND RecordId = :sc.getId() LIMIT 1 ].size() > 0) { return true; } else { return false; } } }
Right now, no queries even fire when I load the page with this:
<apex:page standardController="Account" extensions="AccountUserRecordAccessChecker2" rendered="{AccountUserRecordAccessChecker2.renderELEMENT}" >
Also, I can't get a system.debug to compile in the class.
I think you need to change "renderELEMENT" to "getRenderELEMENT" in class only.
etc