Skip to content

Commit

Permalink
HOME-1781: Added permission template endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
VSevostianov committed Oct 9, 2024
1 parent 64cd262 commit d8f48e7
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions cmd/permissiontemplate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package cmd

import (
"github.com/spf13/cobra"
)

var permissionTemplateCmd = &cobra.Command{
Use: "permission-template",
Short: "Manage permission templates for a team",
Long: "Manage all templates for permissions inside a team.",
}

var permissionTemplateListCmd = &cobra.Command{
Use: "list",
Short: "List permission templates",
Long: "Retrieves a list of permission templates.",
RunE: func(*cobra.Command, []string) error {
c := Api.PermissionTemplates()
data, err := c.ListPermissionRoles(teamId)
if err != nil {
return err
}
return printJson(data)
},
}

func init() {
permissionTemplateCmd.AddCommand(permissionTemplateListCmd)
rootCmd.AddCommand(permissionTemplateCmd)

flagTeamId(permissionTemplateCmd)
}

0 comments on commit d8f48e7

Please sign in to comment.