-
Notifications
You must be signed in to change notification settings - Fork 18
/
svc_permissiontemplates.go
41 lines (33 loc) · 1.14 KB
/
svc_permissiontemplates.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package lokalise
import "fmt"
const (
pathTemplates = "teams/%d/roles"
)
// The PermissionTemplate service
type PermissionTemplateService struct {
BaseService
}
type PermissionTemplate struct {
ID int `json:"id"`
Role string `json:"role"`
Permissions []string `json:"permissions"`
Description string `json:"description"`
Tag string `json:"tag"`
TagColor string `json:"tagColor"`
TagInfo string `json:"tagInfo"`
DoesEnableAllReadOnlyLanguages bool `json:"doesEnableAllReadOnlyLanguages"`
}
type PermissionRoleResponse struct {
Roles []PermissionTemplate `json:"roles"`
}
// List all possible permission roles
func (c *PermissionTemplateService) ListPermissionRoles(teamID int64) (r PermissionRoleResponse, err error) {
resp, err := c.getWithOptions(c.Ctx(), pathPermissionRoles(teamID), &r, c.PageOpts())
if err != nil {
return r, err
}
return r, apiError(resp)
}
func pathPermissionRoles(teamID int64) string {
return fmt.Sprintf(pathTemplates, teamID)
}