Skip to content

Commit

Permalink
daemon: allow polkit "io.snapcraft.snapd.manage" for /v2/apps endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Meulengracht committed Feb 23, 2024
1 parent 4e6e3bd commit f7fea7f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion daemon/api_apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var (
GET: getAppsInfo,
POST: postApps,
ReadAccess: openAccess{},
WriteAccess: authenticatedAccess{},
WriteAccess: authenticatedAccess{Polkit: polkitActionManage},
}

logsCmd = &Command{
Expand Down
6 changes: 6 additions & 0 deletions daemon/api_apps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ func (s *appsSuite) SetUpTest(c *check.C) {
d.Overlord().Loop()
s.AddCleanup(func() { d.Overlord().Stop() })
s.AddCleanup(systemd.MockSystemdVersion(237, nil))
s.expectAppsAccess()
}

func (s *appsSuite) expectAppsAccess() {
s.expectOpenAccess()
s.expectWriteAccess(daemon.AuthenticatedAccess{Polkit: "io.snapcraft.snapd.manage"})
}

func (s *appsSuite) TestSplitAppName(c *check.C) {
Expand Down

0 comments on commit f7fea7f

Please sign in to comment.