Remove unused concept of RolesStore
Signed-off-by: Michael de Sa <mjdesa@gmail.com>pull/10616/head
parent
40428588f2
commit
09050b9c8e
|
@ -20,7 +20,6 @@ type Client struct {
|
|||
ServersStore *ServersStore
|
||||
LayoutStore *LayoutStore
|
||||
UsersStore *UsersStore
|
||||
RolesStore *RolesStore
|
||||
DashboardsStore *DashboardsStore
|
||||
}
|
||||
|
||||
|
@ -30,7 +29,6 @@ func NewClient() *Client {
|
|||
c.SourcesStore = &SourcesStore{client: c}
|
||||
c.ServersStore = &ServersStore{client: c}
|
||||
c.UsersStore = &UsersStore{client: c}
|
||||
c.RolesStore = newRolesStore(c.UsersStore)
|
||||
c.LayoutStore = &LayoutStore{
|
||||
client: c,
|
||||
IDs: &uuid.V4{},
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
package bolt
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/influxdata/chronograf"
|
||||
)
|
||||
|
||||
// Ensure RolesStore implements chronograf.RolesStore.
|
||||
var _ chronograf.RolesStore = &RolesStore{}
|
||||
|
||||
// RolesStore uses bolt to store and retrieve roles
|
||||
type RolesStore struct {
|
||||
mu sync.RWMutex
|
||||
roles map[string]chronograf.Role
|
||||
usersStore *UsersStore
|
||||
}
|
||||
|
||||
// NewRolesStore returns a *RolesStore populated with the
|
||||
// default Chonograf User Roles
|
||||
func newRolesStore(u *UsersStore) *RolesStore {
|
||||
s := &RolesStore{
|
||||
usersStore: u,
|
||||
roles: map[string]chronograf.Role{},
|
||||
}
|
||||
|
||||
for name, role := range chronograf.DefaultUserRoles {
|
||||
s.roles[name] = role
|
||||
}
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
// All returns all roles and all users associated with each role.
|
||||
func (s *RolesStore) All(context.Context) ([]chronograf.Role, error) {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
// Add returns an error and a nil users. It is not intended to be used currently.
|
||||
func (s *RolesStore) Add(context.Context, *chronograf.Role) (*chronograf.Role, error) {
|
||||
return nil, fmt.Errorf("Add not supported for boltdb roles store")
|
||||
}
|
||||
|
||||
// Delete returns an error. It is not intended to be used currently.
|
||||
func (s *RolesStore) Delete(context.Context, *chronograf.Role) error {
|
||||
return fmt.Errorf("Delete not supported for boltdb roles store")
|
||||
}
|
||||
|
||||
// Get retrieves a role and all users associated with it.
|
||||
func (s *RolesStore) Get(ctx context.Context, name string) (*chronograf.Role, error) {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
// Update returns an error. It is not intended to be used currently.
|
||||
func (s *RolesStore) Update(context.Context, *chronograf.Role) error {
|
||||
return fmt.Errorf("Update not supported for boltdb roles store")
|
||||
}
|
|
@ -116,7 +116,6 @@ const (
|
|||
ErrLayoutNotFound = Error("layout not found")
|
||||
ErrDashboardNotFound = Error("dashboard not found")
|
||||
ErrUserNotFound = Error("user not found")
|
||||
ErrRoleNotFound = Error("role not found")
|
||||
ErrLayoutInvalid = Error("layout is invalid")
|
||||
ErrAlertNotFound = Error("alert not found")
|
||||
ErrAuthentication = Error("user not authenticated")
|
||||
|
|
Loading…
Reference in New Issue