app/controllers/scrivito/workspaces_controller.rb in scrivito_sdk-0.65.2 vs app/controllers/scrivito/workspaces_controller.rb in scrivito_sdk-0.66.0.rc1

- old
+ new

@@ -4,11 +4,11 @@ around_action :authorize_current_workspace_read, only: :show around_action :authorize_current_workspace_write, only: [:update, :destroy, :rebase] around_action :authorize_current_workspace_publish, only: [:check, :publish] def index - @workspaces = all_workspaces.select do |workspace| + @workspaces = Workspace.all.select do |workspace| can_user_access_workspace?(:read, workspace) end render :workspaces end @@ -152,14 +152,8 @@ raise ClientError.new( 'Content state id changed', 400, 'precondition_not_met.workspace.publish.content_state_id' ) - end - - def all_workspaces - CmsRestApi.get('/workspaces')['results'].map do |raw_data| - Workspace.new(WorkspaceData.new(raw_data)) - end end end end