mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Migrate Roles Layered store to Sync by default (#10790)
* Migrate Roles Layered store to Sync by default * Fixing govet * Addressing PR review comments
This commit is contained in:
committed by
Jesse Hallam
parent
fb01d37846
commit
6d1ac00330
@@ -260,46 +260,32 @@ type LayeredRoleStore struct {
|
||||
*LayeredStore
|
||||
}
|
||||
|
||||
func (s *LayeredRoleStore) Save(role *model.Role) StoreChannel {
|
||||
return s.RunQuery(func(supplier LayeredStoreSupplier) *LayeredStoreSupplierResult {
|
||||
return supplier.RoleSave(s.TmpContext, role)
|
||||
})
|
||||
func (s *LayeredRoleStore) Save(role *model.Role) (*model.Role, *model.AppError) {
|
||||
return s.LayerChainHead.RoleSave(s.TmpContext, role)
|
||||
}
|
||||
|
||||
func (s *LayeredRoleStore) Get(roleId string) StoreChannel {
|
||||
return s.RunQuery(func(supplier LayeredStoreSupplier) *LayeredStoreSupplierResult {
|
||||
return supplier.RoleGet(s.TmpContext, roleId)
|
||||
})
|
||||
func (s *LayeredRoleStore) Get(roleId string) (*model.Role, *model.AppError) {
|
||||
return s.LayerChainHead.RoleGet(s.TmpContext, roleId)
|
||||
}
|
||||
|
||||
func (s *LayeredRoleStore) GetAll() StoreChannel {
|
||||
return s.RunQuery(func(supplier LayeredStoreSupplier) *LayeredStoreSupplierResult {
|
||||
return supplier.RoleGetAll(s.TmpContext)
|
||||
})
|
||||
func (s *LayeredRoleStore) GetAll() ([]*model.Role, *model.AppError) {
|
||||
return s.LayerChainHead.RoleGetAll(s.TmpContext)
|
||||
}
|
||||
|
||||
func (s *LayeredRoleStore) GetByName(name string) StoreChannel {
|
||||
return s.RunQuery(func(supplier LayeredStoreSupplier) *LayeredStoreSupplierResult {
|
||||
return supplier.RoleGetByName(s.TmpContext, name)
|
||||
})
|
||||
func (s *LayeredRoleStore) GetByName(name string) (*model.Role, *model.AppError) {
|
||||
return s.LayerChainHead.RoleGetByName(s.TmpContext, name)
|
||||
}
|
||||
|
||||
func (s *LayeredRoleStore) GetByNames(names []string) StoreChannel {
|
||||
return s.RunQuery(func(supplier LayeredStoreSupplier) *LayeredStoreSupplierResult {
|
||||
return supplier.RoleGetByNames(s.TmpContext, names)
|
||||
})
|
||||
func (s *LayeredRoleStore) GetByNames(names []string) ([]*model.Role, *model.AppError) {
|
||||
return s.LayerChainHead.RoleGetByNames(s.TmpContext, names)
|
||||
}
|
||||
|
||||
func (s *LayeredRoleStore) Delete(roldId string) StoreChannel {
|
||||
return s.RunQuery(func(supplier LayeredStoreSupplier) *LayeredStoreSupplierResult {
|
||||
return supplier.RoleDelete(s.TmpContext, roldId)
|
||||
})
|
||||
func (s *LayeredRoleStore) Delete(roldId string) (*model.Role, *model.AppError) {
|
||||
return s.LayerChainHead.RoleDelete(s.TmpContext, roldId)
|
||||
}
|
||||
|
||||
func (s *LayeredRoleStore) PermanentDeleteAll() StoreChannel {
|
||||
return s.RunQuery(func(supplier LayeredStoreSupplier) *LayeredStoreSupplierResult {
|
||||
return supplier.RolePermanentDeleteAll(s.TmpContext)
|
||||
})
|
||||
func (s *LayeredRoleStore) PermanentDeleteAll() *model.AppError {
|
||||
return s.LayerChainHead.RolePermanentDeleteAll(s.TmpContext)
|
||||
}
|
||||
|
||||
type LayeredSchemeStore struct {
|
||||
|
||||
Reference in New Issue
Block a user