Hi i read something to restrict access based on user
my question is a bit different from the stuff i found
may i restrict access for a single record to users except me (the admin)?
thanks
Yes, you can as long as the record you want to return can be uniquely tied to that user. Email address is the most reliable linkage to use because email address is always unique even though name may not be. You can obtain the identity of the individual who is logged on to the application with User().Email.
I currently have an application that allows a user to submit and update their resume. When the user accesses the application, the only thing they will ever see is their own resume and associated information stored about themselves. They cannot see anything else. If an admin logs on they can see the records for any individual in the system.
thanks for the answer
yes, i'd like to have some records visible only by me (admin)
i know the user().email...but how may i set a record visible only by me?
The exact syntax is going to depend on the specifics of your application, but in mine, it's done with the filter on the gallery. My app actually presents different information based on 3 different personnas: an individual consultant, a manager or a resource manager. I have a series of checks that set global variables that tell me if the person is a manager or resource manager, then I have an If statement that looks at those global variables and performs the right filter. A very simplified version of my code would be something like this.
//* check to see if the person has been identified as a resource manager If (IsResourceManager, Filter(ListOfData, <list of conditions>, //* if they weren't a resource manager, check to see if they are a manager IsManager, Filter(colResources, Email4Resource in AllReports.userPrincipalName || Email4Resource in AllReports.UserPrincipalName, //* if they weren't a resource manager or a manager, they must be an individual Filter(colResources,Email4Resource = CurrentUserEmail))
My data is loaded into a collection (colResources) and I have a second collection I have built which lists the identities of the manager's direct reports (AllReports).
thanks very much
i decided to add a yes/no field called manager, if is true my collaborator cannot see the record
If( User().FullName = "diego marino"; Filter( Candidati; StartsWith( ComuneDesc; TBcandidatifiltrocomune.Text ) && (IsBlank(TBcandidatifiltroptftrasferibile.Text) || DPcandidatifiltroptftrasferibile.Selected.Value = "=" && 'Ptf trasferibile personale' = Value(TBcandidatifiltroptftrasferibile.Text) || DPcandidatifiltroptftrasferibile.Selected.Value = ">=" && 'Ptf trasferibile personale' >= Value(TBcandidatifiltroptftrasferibile.Text) || DPcandidatifiltroptftrasferibile.Selected.Value = "<=" && 'Ptf trasferibile personale' <= Value(TBcandidatifiltroptftrasferibile.Text)) && (StartsWith( Cognome; TBcercacandidato.Text )) && (IsBlank(TBcandidatifiltroptfbanca.Text) || DPcandidatifiltroptfbanca.Selected.Value = "=" && 'Ptf banca personale' = Value(TBcandidatifiltroptfbanca.Text) || DPcandidatifiltroptfbanca.Selected.Value = ">=" && 'Ptf banca personale' >= Value(TBcandidatifiltroptfbanca.Text) || DPcandidatifiltroptfbanca.Selected.Value = "<=" && 'Ptf banca personale' <= Value(TBcandidatifiltroptfbanca.Text)) ); Filter( Candidati; StartsWith( ComuneDesc; TBcandidatifiltrocomune.Text ) && (Manager <> true) && (IsBlank(TBcandidatifiltroptftrasferibile.Text) || DPcandidatifiltroptftrasferibile.Selected.Value = "=" && 'Ptf trasferibile personale' = Value(TBcandidatifiltroptftrasferibile.Text) || DPcandidatifiltroptftrasferibile.Selected.Value = ">=" && 'Ptf trasferibile personale' >= Value(TBcandidatifiltroptftrasferibile.Text) || DPcandidatifiltroptftrasferibile.Selected.Value = "<=" && 'Ptf trasferibile personale' <= Value(TBcandidatifiltroptftrasferibile.Text)) && (StartsWith( Cognome; TBcercacandidato.Text )) && (IsBlank(TBcandidatifiltroptfbanca.Text) || DPcandidatifiltroptfbanca.Selected.Value = "=" && 'Ptf banca personale' = Value(TBcandidatifiltroptfbanca.Text) || DPcandidatifiltroptfbanca.Selected.Value = ">=" && 'Ptf banca personale' >= Value(TBcandidatifiltroptfbanca.Text) || DPcandidatifiltroptfbanca.Selected.Value = "<=" && 'Ptf banca personale' <= Value(TBcandidatifiltroptfbanca.Text)) ) )
i tried to add a single condition between the other to save code but didn't work
Filter( Candidati; StartsWith( ComuneDesc; TBcandidatifiltrocomune.Text ) && (User().FullName = "Diego marino" || Manager <> true) && (IsBlank(TBcandidatifiltroptftrasferibile.Text) || DPcandidatifiltroptftrasferibile.Selected.Value = "=" && 'Ptf trasferibile personale' = Value(TBcandidatifiltroptftrasferibile.Text) || DPcandidatifiltroptftrasferibile.Selected.Value = ">=" && 'Ptf trasferibile personale' >= Value(TBcandidatifiltroptftrasferibile.Text) || DPcandidatifiltroptftrasferibile.Selected.Value = "<=" && 'Ptf trasferibile personale' <= Value(TBcandidatifiltroptftrasferibile.Text)) && (StartsWith( Cognome; TBcercacandidato.Text )) && (IsBlank(TBcandidatifiltroptfbanca.Text) || DPcandidatifiltroptfbanca.Selected.Value = "=" && 'Ptf banca personale' = Value(TBcandidatifiltroptfbanca.Text) || DPcandidatifiltroptfbanca.Selected.Value = ">=" && 'Ptf banca personale' >= Value(TBcandidatifiltroptfbanca.Text) || DPcandidatifiltroptfbanca.Selected.Value = "<=" && 'Ptf banca personale' <= Value(TBcandidatifiltroptfbanca.Text)) )
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
261 | |
130 | |
86 | |
86 | |
68 |