From b4ee6fa280daf8cfbc6229a89f553e3c6d12b02c Mon Sep 17 00:00:00 2001 From: artinu777 <44579371+artinu777@users.noreply.github.com> Date: Tue, 16 Jul 2024 13:25:32 +0300 Subject: [PATCH] Update permission.go missing method getPermissionBySubmitter --- casdoorsdk/permission.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/casdoorsdk/permission.go b/casdoorsdk/permission.go index ff454e7..1d520c2 100644 --- a/casdoorsdk/permission.go +++ b/casdoorsdk/permission.go @@ -87,6 +87,22 @@ func (c *Client) GetPermissionsByRole(name string) ([]*Permission, error) { return permissions, nil } +func (c *Client) GetPermissionsBySubmitter() ([]*Permission, error) { + url := c.GetUrl("get-permissions-by-submitter") + + bytes, err := c.DoGetBytes(url) + if err != nil { + return nil, err + } + + var permissions []*Permission + err = json.Unmarshal(bytes, &permissions) + if err != nil { + return nil, err + } + return permissions, nil +} + func (c *Client) GetPaginationPermissions(p int, pageSize int, queryMap map[string]string) ([]*Permission, int, error) { queryMap["owner"] = c.OrganizationName queryMap["p"] = strconv.Itoa(p)