cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
max81
Kudo Kingpin
Kudo Kingpin

Change permission as Admin via PowerAppsforAdmins - Connector

Hi,

 

I want to change via button the permission. To make it ease, I want to change it to "CanEdit". My code runs without error, but without changing the permission.

Can anybody help?

 

PowerAppsforAdmins.EditAdminAppRoleAssignment(
  EnviromentID, AppID,
  {
    '$filter': "enviornment eq '"& EnviromentID&"'",
    put: Table({
      properties: {
        roleName: "CanEdit",
        capabilities: [""],
        NotifyShareTargetOption: "",
        principal: {
          email: UserEmail,
          id: UserID,
          type: "User",
          tenantId: "null" 
        }
      }
    })
  }
);

 

Adding someone or deleting someone is working fine.

 

1 ACCEPTED SOLUTION

Accepted Solutions
max81
Kudo Kingpin
Kudo Kingpin

@barlowse 

 

UPDATE:

I fixed it! The Problem was the empty string in the notification part. I have to replace it with a blank().

 

PowerAppsforAdmins.EditAdminAppRoleAssignment(
  EnviromentID, AppID,
  {
    '$filter': "enviornment eq '"& EnviromentID&"'",
    put: Table({
      properties: {
        roleName: "CanEdit",
        capabilities: [""],
        NotifyShareTargetOption: Blank(),
        principal: {
          email: UserEmail,
          id: UserID,
          type: "User",
          tenantId: "null" 
        }
      }
    })
  }
);

 

View solution in original post

2 REPLIES 2
barlowse
Advocate V
Advocate V

Did you get this to work? I am trying to do the same thing.

max81
Kudo Kingpin
Kudo Kingpin

@barlowse 

 

UPDATE:

I fixed it! The Problem was the empty string in the notification part. I have to replace it with a blank().

 

PowerAppsforAdmins.EditAdminAppRoleAssignment(
  EnviromentID, AppID,
  {
    '$filter': "enviornment eq '"& EnviromentID&"'",
    put: Table({
      properties: {
        roleName: "CanEdit",
        capabilities: [""],
        NotifyShareTargetOption: Blank(),
        principal: {
          email: UserEmail,
          id: UserID,
          type: "User",
          tenantId: "null" 
        }
      }
    })
  }
);

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (2,392)