forked from lokalise/lokalise-cli-2-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HOME-1781: Added permission template endpoint
- Loading branch information
1 parent
64cd262
commit d8f48e7
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |