web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Pages - Security
Suggested answer

Displaying portal user email records

(1) ShareShare
ReportReport
Posted on by 2
Hi,
 
I am trying to develop a portal wherein users will be contacts from several accounts.
 
The problem I am having is displaying emails wherein that contact record is set as CC, Can someone help me to figure out how do i set-up the table permission for the email entity such that the current logged in portal user can also see the emails they were CC'ed aside from setting the table permission to global level? Thank you!
Categories:
I have the same question (0)
  • CU30071913-0 Profile Picture
    2 on at
    Displaying portal user email records
    Hi @Jon Unzueta Thanks for your response.
     
    The problem i am having is exposing the emails for the user on the page, based on the provided solution, i will still need to provide them an access to email entity via table permissions. How would I set it up such that they will be able to see the email records wherein the contact record belongs to To and/or CC fields of the email?
     
    Options 2 and 3 will not be possible for us as we wanted to really utilize the existing relationship between the contact record and the emails they are a receipient of. We would have wanted the contact records to have the proper table permissions for them to have visibility on emails but is restricted and is exclusive to only emails that involve them. Thank you.
  • Suggested answer
    Jon Unzueta Profile Picture
    1,215 Super User 2025 Season 2 on at
    Displaying portal user email records
     

     Understanding the Challenge

    By default, Dataverse Table Permissions in Power Pages (formerly Power Apps Portals) are based on direct relationships like:

    • Contact is the owner of the record.
    • Contact is regarding or To on the email.

    However, CC recipients are stored in the ActivityParty table, which is a many-to-many relationship and not directly exposed in table permissions.


    🛠️ Solution Options

    Option 1: Use a Custom Web Role + Web Template

    1. Create a custom Web Role for portal users.

    2. Create a custom Web Template or Liquid FetchXML that:

      • Queries the ActivityPointer (Email) table.
      • Joins with ActivityParty where ParticipationTypeMask = 3 (which means CC).
      • Filters by the current user's contact ID.

      Example FetchXML snippet:

    <fetch>
      <entity name="email">
        <attribute name="subject" />
        <attribute name="activityid" />
        <link-entity name="activityparty" from="activityid" to="activityid" alias="cc">
          <filter>
            <condition attribute="participationtypemask" operator="eq" value="3" />
            <condition attribute="partyid" operator="eq" value="{{ user.contact.id }}" />
          </filter>
        </link-entity>
      </entity>
    </fetch>

     

    3.-Display the results in a custom Web Page or Entity List using Liquid.


    Option 2: Create a Custom N:N Relationship

    If you want to use Entity Permissions instead of custom code:

    1. Create a custom N:N relationship between Contact and Email.
    2. Use a plugin or Power Automate flow to populate this relationship when a contact is added as CC.
    3. Set up Entity Permissions on this relationship so that portal users can see related emails.

    Option 3: Use Power Automate to Copy CC Emails

    As a workaround:

    • Use a Power Automate flow to create a custom record (e.g., ContactEmailAccess) whenever a contact is CC'ed.
    • Link it to the email and the contact.
    • Use this table to drive permissions and display.

    🔐 Security Note

    Avoid setting Global permissions unless absolutely necessary. The above approaches ensure least privilege access while still exposing relevant data.

     

    🏷️ Tag me if you have any further questions or if the issue persists.

    ✅ Click "Accept as Solution" if my post helped resolve your issue—it helps others facing similar problems. ❤️ Give it a Like if you found the approach useful in any way.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#2
Lucas001 Profile Picture

Lucas001 48 Super User 2025 Season 2

#3
KevinGador Profile Picture

KevinGador 44 Super User 2025 Season 2

Featured topics