Permissions, screens or multiple apps
-
Permissions, screens or multiple apps
Posted by DSC Communities on November 26, 2019 at 7:32 am-
Kassie Navarasi
MemberNovember 26, 2019 at 7:32 AM
Hello Everyone,
I’m currently creating a power app that’s connected to sharepoint list.
I’d need customers to input the app (restricted view)while going back into it to update it if needed.
Also the client to be able to go into it to add more details.. send out approvals etc.
Please can you guys advise me on the best way to go around this.
How do I restrict the view based on permissions on powerapps?
Thank you!!
Kassie
Would you like to be kept up to date with Blackpool Council news? Sign up here – http://www.blackpool.gov.uk/YourBlackpool http://www.blackpool.gov.uk/EmailDisclaimer/ This message has been scanned for inappropriate or malicious content as part of the Council’s e-mail and Internet policies.
This message may contain confidential information. If you are not the intended recipient please inform the sender that you have received the message in error before deleting it. Please do not disclose, copy or distribute information in this e-mail or take any action in relation to its contents. To do so is strictly prohibited and may be unlawful. Thank you for your co-operation.
-
Peter Heffner
MemberNovember 27, 2019 at 3:12 AM
Hi Kassie,Ā
Is that correct: On Sharepoint the users have restricted view, but on the other hand they need to update data through Power App?
As we can’t use the Sharepoint permissions directly in Power Apps, I go for this scenario.
Create a client list and a customer list with all the emails in it.
When the app is started I check if user().mail is in one of the lists.
This way I know if it is a client or a customer who is logged in.
Based on this information I set the visible parameter of a button to true/false and let the user navigate to the correct page.
This also enables you to display or hide certain fields or change the displaymode to disable or edit.Is this what you are looking for?
——————————
Peter Heffner
Intranet Solution Specialist III
——————————
——————————————- -
Warren Belz
MemberNovember 27, 2019 at 6:53 AM
Hi Kassie,
There are a couple of usefulĀ built-in PowerApps parameters that can be used to determine who is logged in – User().FullName and User().Email.Ā The easiest way to control things would be to have another control list (SharePoint will do this well) with this data on the users of the app with one of these user parameters and another field with what permissions you want to give them.
I will use a very simple example where this list (I will call it UserList and the fields UserName and EditFields) contains the user’s full name and a Boolean value as to whether to set read only for certain fields.
So on App OnStartĀ (or OnVisible of the relevant screen), I would have a Boolean variable (bCanEdit) set byĀ
Set(
bCanEdit,
LookUp (
UserList,
User().FullName = UserName,
EditFields
)
)
Then set the DisplayMode of the target fields to
If(bCanEdit,
DisplayMode.Edit,
DisplayMode.View
)
Is this what you are after?
——————————
Warren Belz
Ventia Utility Services Pty Ltd
Rockhampton Qld Australia
+61 409 315 509
——————————
——————————————- -
Kassie Navarasi
MemberNovember 27, 2019 at 7:12 AM
Hello!Thank you so much for that! That is really helpful! Didn’t know powerapps could do that!
In our case, the whole organisation should have access to add and edit their own record with restricted view. So I’m thinking, these people will only be able to access screen 1. (similar to Sharepoint permissions)
However, a handful of people will have access to see all records and also have access to screen 2.Hope that makes sense!
Kassie——————————
Kassie Navarasi
TV Studio & Digital Media Manager
07463338041
——————————
——————————————- -
Warren Belz
MemberNovember 27, 2019 at 4:07 PM
Hi Kassie,
You can also test for who created the record. There are many variations to do this – I will give one example based on another Boolean Variable (I used bCurrUser) – just replace YourGallery with the actual name.
On selecting the record, you can put something like: –
Set(
bCurrUser,
User().FullName = YourGallery.Selected.’Created By’.DisplayName)
This will return true or false depending whether the user created the selected record.
Adding to the first post, the DisplayMode of the relevant card could be:-
If(
bCanEdit || bCurrUser,
DisplayMode.Edit,
DisplayMode.View
)
The “||” can also be
Or (
bCanEdit,
bCurrUser
)
Is this what you are after?
——————————
Warren Belz
Ventia Utility Services Pty Ltd
Rockhampton Qld Australia
+61 409 315 509
——————————
——————————————- -
Peter Heffner
MemberNovember 28, 2019 at 12:32 AM
In our company ‘DisplayName’ doesn’t return unique results as we have so many colleagues with the same first and last name. I go with the email address which is unique like john.doe@acme.com; john.doe2@acme.com….——————————
Peter Heffner
Intranet Solution Specialist III
——————————
——————————————- -
Warren Belz
MemberDecember 1, 2019 at 3:18 AM
Hi Peter,You are completely correct if more than one identically-named staff uses the particular app.
Your comment made me think a bit as I have always used User().FullName to match the logged-in name against a control table of authorities and Gallery.Selected.’Created By’.DisplayName to make sure the current user owns the record.
Fortunately, we have yet to run across any “doubles” in the same workgroup.
——————————
Warren Belz
Ventia Utility Services Pty Ltd
Rockhampton Qld Australia
+61 409 315 509
——————————
——————————————- -
Peter Heffner
MemberDecember 2, 2019 at 1:51 AM
Yes, If you deal with potentially 70k users around the world double user names are very likely.
Oh, and btw Power Apps is case sensitive when it comes to comparing email addresses.Sometimes I hard code back doors for one or two admins.
I always type lower case email addresses and useĀ Lower(user().mail)) = “john.doe@acme.com” to make life easier.——————————
Peter Heffner
Intranet Solution Specialist III
——————————
——————————————-
DSC Communities replied 6 years, 4 months ago 1 Member · 0 Replies -
-
0 Replies
Sorry, there were no replies found.
The discussion ‘Permissions, screens or multiple apps’ is closed to new replies.