refactoring changes due to acl.Capabilities

This commit is contained in:
vishalnayak
2016-03-04 13:21:07 -05:00
parent 0792b14736
commit 7f832f22aa
6 changed files with 30 additions and 101 deletions

View File

@@ -1,6 +1,6 @@
package api
func (c *Sys) CapabilitiesSelf(path string) (*CapabilitiesResponse, error) {
func (c *Sys) CapabilitiesSelf(path string) ([]string, error) {
body := map[string]string{
"path": path,
}
@@ -18,10 +18,10 @@ func (c *Sys) CapabilitiesSelf(path string) (*CapabilitiesResponse, error) {
var result CapabilitiesResponse
err = resp.DecodeJSON(&result)
return &result, err
return result.Capabilities, err
}
func (c *Sys) Capabilities(token, path string) (*CapabilitiesResponse, error) {
func (c *Sys) Capabilities(token, path string) ([]string, error) {
body := map[string]string{
"token": token,
"path": path,
@@ -40,7 +40,7 @@ func (c *Sys) Capabilities(token, path string) (*CapabilitiesResponse, error) {
var result CapabilitiesResponse
err = resp.DecodeJSON(&result)
return &result, err
return result.Capabilities, err
}
type CapabilitiesResponse struct {