• dtillery
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

Hey guys,

 

I have a visualforce page, and I'm including several other visualforce pages within it.  Each of these pages have access restrictions based on different profiles (some people can use only 1 of the included pages, some can use 2, etc...).  If I include them all on the same page, then users will get the standard Access Restricted message for pages that aren't available to them.

 

Instead I'd rather not render the page at all if a user's profile does not give them access to it, so they don't see the error message.  I could do some silly "If user.profile == A or B or C..." logic, but I'd rather not have to edit the code every time some new profile needs access to a new page.

 

Basically I'm wondering if there's a way in either the Visualforce page or the controller to tell if a person has access to a page, sort of like how you can check for Object accessibility with {!$ObjectType.objectname.accessible}.

 

Also open to other suggestions if there's a better way.  I'm new to the force ecosystem so I may just be missing something simple.

 

Thanks!