Split Emojis and Webhooks permissions (#10239)
* Split Emojis and Webhooks permissions * Fixing some tests * Fixing more tests * Fix more tests * Fixed review comments * Fixing review comments
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
a4e3dfaebc
Коммит
84afd47021
@@ -160,6 +160,28 @@ func (s *SqlSupplier) RoleGet(ctx context.Context, roleId string, hints ...store
|
||||
return result
|
||||
}
|
||||
|
||||
func (s *SqlSupplier) RoleGetAll(ctx context.Context, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
result := store.NewSupplierResult()
|
||||
|
||||
var dbRoles []Role
|
||||
|
||||
if _, err := s.GetReplica().Select(&dbRoles, "SELECT * from Roles", map[string]interface{}{}); err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
result.Err = model.NewAppError("SqlRoleStore.GetAll", "store.sql_role.get_all.app_error", nil, err.Error(), http.StatusNotFound)
|
||||
} else {
|
||||
result.Err = model.NewAppError("SqlRoleStore.GetAll", "store.sql_role.get_all.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
}
|
||||
|
||||
var roles []*model.Role
|
||||
for _, dbRole := range dbRoles {
|
||||
roles = append(roles, dbRole.ToModel())
|
||||
}
|
||||
result.Data = roles
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
func (s *SqlSupplier) RoleGetByName(ctx context.Context, name string, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
result := store.NewSupplierResult()
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user