cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
prathyoo
Helper I
Helper I

Record level access for on-behalf of user

Hi,

 

We would like to build a canvas app against a table in Dataverse. An end user should be able to create records in the table only through the canvas app. The user should not have direct access to the underlying dataverse table from make.powerapps.com. Also, there is a field on the table called 'On Behalf Of'. The user who is creating a record using the canvas app can pick another user in the 'On Behalf Of' column. Now, the access that we need is that both the creator of the record as well as the user in 'On Behalf Of' field need Read/Write access to the record (again only through the canvas app). I understand that if the table was a Sharepoint List then this could be possible by changing the item level permissions (though we still have the issue that user's can directly access the SP List).

 

Would like some guidance on how we can use dataverse to achieve the above. 

2 ACCEPTED SOLUTIONS

Accepted Solutions
dpoggemann
Super User
Super User

Hi @prathyoo ,

 

A couple things on your business case here...

  1. If you give the user access to modify the data in the canvas application, this would be done through Dataverse Roles and the roles are for the data access specifically, not from a specific application.   It is an important distinction that if they have access to the data from the role in Dataverse, they will have access from the front-end canvas app, from web apis, and any other access to that environment.
  2. The "On Behalf Of", this type of functionality for records can be accomplished using Access Teams.  You would identify the owner as one of the two users and the other would be part of an access team assigned to the record.  Please see the following for Access team details (https://youtu.be/0jr4QTjdXwg
Hope this helps. Please accept if answers your question or Like if helps in any way.
Thanks,
Drew

View solution in original post

dpoggemann
Super User
Super User

Hi @spow ,

 

Based on your specific need I would do the following, let me know if this answers your question...

  1. Delegated user needs to have the ability to create the leave record in Dataverse security role assigned.
  2. User will set a field on the leave record as the "On Behalf Of" user (which should be their manager)
  3. Setup a real-time workflow that when this record is created (or if that "On Behalf Of" value is updated) to set the owner of the leave record to the value of the "On Behalf Of" user.  Note, this workflow should not run under the user but under admin (https://www.beringer.net/beringerblog/dynamics-365-running-workflows-as-an-admin-vs-an-end-user/

At this point the record will not be tied at all to the user that created it, it will be owned by the Manager so he / she will have access and the roles will of course allow HR to see the records.

 

Your case is a bit different so I would not use Access Teams for your scenario as you do not need the end user that created the record to maintain access to it...

 

Hope this helps. Please accept if answers your question or Like if helps in any way.
Thanks,
Drew

View solution in original post

7 REPLIES 7
dpoggemann
Super User
Super User

Hi @prathyoo ,

 

A couple things on your business case here...

  1. If you give the user access to modify the data in the canvas application, this would be done through Dataverse Roles and the roles are for the data access specifically, not from a specific application.   It is an important distinction that if they have access to the data from the role in Dataverse, they will have access from the front-end canvas app, from web apis, and any other access to that environment.
  2. The "On Behalf Of", this type of functionality for records can be accomplished using Access Teams.  You would identify the owner as one of the two users and the other would be part of an access team assigned to the record.  Please see the following for Access team details (https://youtu.be/0jr4QTjdXwg
Hope this helps. Please accept if answers your question or Like if helps in any way.
Thanks,
Drew
spow
Helper I
Helper I

I have the same issue. I’ve watched the YouTube and others about Access Teams and that aligns it to a D365 scenario, not so much canvas app with Dataverse as a respository. 
My issue is an HR app where a manager may need to delegate a user to add an entry on their behalf. The manager would need to see the entry the on behalf user has created. I get that the access team covers this but don’t understand how it connects up. The video talks about a team template then adding a sub grid to the form but that does not align to my app. 
Can anyone guide me further, I’m sure I’m missing something small!

dpoggemann
Super User
Super User

Hi @spow ,

 

In your situation you are having an individual create records within Dataverse and the Manager needs access to these records or do you want the owner to be setup as the Manager and the on behalf user still have access to the record?   Just want to make sure I understand what you want to happen as there are a number of options here.  

 

Example options:

  1. Configure hierarchical security for manager / employee and the manager will be able to maintain child records (https://learn.microsoft.com/en-us/power-platform/admin/hierarchy-security
  2. You could have employee create the record and set an "On-Behalf User" on the record and have a real-time workflow (or flow) that will run to change the owner of the record to the manager and add the employee to an access team so they still have access. Note, this workflow would need to run with elevated user like a system administrator.
  3. You could allow user to create the record and automatically (through a Power Automate Flow or a real-time workflow) add the Manager to an Access team to be able to access the record.

Once you provide access you can have a view setup in Dataverse that will show the user's records and can include the records they have access through Access team assignment as well.  See Neil's article here (https://neilparkhurst.com/2021/10/31/view-records-owned-by-an-access-team/)

 

 

Hope this helps. Please accept if answers your question or Like if helps in any way.
Thanks,
Drew

Thank you so much for taking the time to reply. 

The scenario is the logging of an absence. Because of the content of this, the data needs to be locked down so that just the HR team see all the records and the manager just sees what they have logged. I’ve sorted that with security roles, tested it and it works fine. 
There are scenarios where a user would do this on behalf of the manager and the manager would need to see those entries to update them. 
My confusion is how does the access team link to the Dataverse table? The vids I’ve watched talk about team templates and sub grids. 

I’ll check out your link and let you know if I’m still confused! 

spow
Helper I
Helper I

Yes still confused! 🤦‍♀️

dpoggemann
Super User
Super User

Hi @spow ,

 

Based on your specific need I would do the following, let me know if this answers your question...

  1. Delegated user needs to have the ability to create the leave record in Dataverse security role assigned.
  2. User will set a field on the leave record as the "On Behalf Of" user (which should be their manager)
  3. Setup a real-time workflow that when this record is created (or if that "On Behalf Of" value is updated) to set the owner of the leave record to the value of the "On Behalf Of" user.  Note, this workflow should not run under the user but under admin (https://www.beringer.net/beringerblog/dynamics-365-running-workflows-as-an-admin-vs-an-end-user/

At this point the record will not be tied at all to the user that created it, it will be owned by the Manager so he / she will have access and the roles will of course allow HR to see the records.

 

Your case is a bit different so I would not use Access Teams for your scenario as you do not need the end user that created the record to maintain access to it...

 

Hope this helps. Please accept if answers your question or Like if helps in any way.
Thanks,
Drew

Hello

 

I have now tested this and it works really well for our scenario.

 

I really appreciate your time in helping me, thank you so much.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Users online (5,543)