SBX - Search With Button

SBX - Forum Post Title

SystemUserRoles doesn't show up in Portal Entity Permission

Microsoft Dynamics CRM Forum

sanjeev40084 asked a question on 14 May 2019 11:23 AM

Question Status

Suggested Answer

I need to display dropdown of users within certain security role in my Dynamics Portal. In order to get list in my portal i am using fetchxml and it needs to link systemuser, systemuserroles and role entities. I was able to add read permission for systemuser and role entity in Portal > Entity Permission but i can't find 'systemuserroles' as one of the option under 'Entity Name' dropdown in Entity Permission page. 

Does anyone know how i can achieve this?

Here is the fetch xml that i ran in XrmToolbox:

<fetch mapping="logical" count="50" version="1.0">
  <entity name="systemuser">
    <attribute name="fullname" />
    <link-entity name="systemuserroles" from="systemuserid" to="systemuserid">
      <link-entity name="role" from="roleid" to="roleid">
        <filter>
          <condition attribute="name" operator="eq" value="salesperson" />
        </filter>
      </link-entity>
    </link-entity>
  </entity>
</fetch>

Here is the fetch xml that i have in portal:

{% fetchxml feed %}
	<fetch mapping="logical" count="50" version="1.0">
	  <entity name="systemuser">
		<attribute name="fullname" />
		<link-entity name="systemuserroles" from="systemuserid" to="systemuserid">
		  <link-entity name="role" from="roleid" to="roleid">
			<filter>
			  <condition attribute="name" operator="eq" value="salesperson" />
			</filter>
		  </link-entity>
		</link-entity>
	  </entity>
	</fetch>
{% endfetchxml %}
<tr>
	<td>
		User:
		<select>
			<option value="" disabled="disabled" selected="selected">- Please select a name -</option>
			{% for item in feed.results.entities %}				
				<option value='{{item.systemuserid}}'>{{item.fullname}}</option>
			{% endfor %}
		</select>
	</td>
</tr>

Portal > Entity Permission

Thank 

Sanjeev

Reply
Ravi Kashyap responded on 14 May 2019 7:20 PM
Suggested Answer

Hi Sanjeev,

This is because entity "SystemUserRoles' is not enabled for advance find which is why it is not available in the list to select. Only entities which are enabled displays in the list.

Did you just try System User entity permissions? You can still add permissions for System User role  by making the Entity field as editable and then type in the text "systemuserrole". This worked for me but later it looks like that it doesn't need permissions for the linked entity, only main entity will work

Hope this helps

Reply
sanjeev40084 responded on 15 May 2019 6:51 AM

@RaviKashyap

I added read permission on 'systemuser' and 'role' entity under 'entity permission' and while running above fetch xml, nothing got returned. i know the fetch xml code is right since i am able to get record while running in XrmToolbox.

Reply
Ravi Kashyap responded on 15 May 2019 5:48 PM

Hi,

Did you add the entity permission to the web role?

Reply
Ravi Kashyap responded on 14 May 2019 7:20 PM
Suggested Answer

Hi Sanjeev,

This is because entity "SystemUserRoles' is not enabled for advance find which is why it is not available in the list to select. Only entities which are enabled displays in the list.

Did you just try System User entity permissions? You can still add permissions for System User role  by making the Entity field as editable and then type in the text "systemuserrole". This worked for me but later it looks like that it doesn't need permissions for the linked entity, only main entity will work

Hope this helps

Reply

SBX - Two Col Forum

SBX - Migrated JS