Skip to content
Snippets Groups Projects
Commit a68f4cce authored by Marcela Ribeiro de Oliveira's avatar Marcela Ribeiro de Oliveira
Browse files

finished routes to add and remove subjects and educational_stages

parent ffce3ff3
No related branches found
No related tags found
No related merge requests found
......@@ -8,10 +8,10 @@ class V1::CollectionsController < ApplicationController
include ::SubjectableController
include ::StageableController
before_action :authenticate_user!, except: [:create, :index, :show]
before_action :set_collection, only: [:show, :update, :destroy, :add_object, :delete_object]
before_action :authenticate_user!, only: [:create, :update, :destroy]
before_action :set_collection, only: [:show, :update, :destroy, :add_object, :delete_object, :subjecting, :unsubjecting, :add_stages, :remove_stages]
before_action :set_new_collection, only: :index
before_action :authorize!, except: [:create, :tagging, :untagging, :subjecting, :unsubjecting, :add_stages, :remove_stages]
before_action :authorize!, except: [:create, :tagging, :untagging]
# GET /v1/collections
# GET /v1/collections.json
......
......@@ -9,10 +9,10 @@ class V1::LearningObjectsController < ApplicationController
include ::SubjectableController
include ::StageableController
before_action :authenticate_user!, except: [:create, :index, :show]
before_action :set_learning_object, only: [:show, :update, :destroy]
before_action :authenticate_user!, only: [:create, :update, :destroy]
before_action :set_learning_object, only: [:show, :update, :destroy, :subjecting, :unsubjecting, :add_stages, :remove_stages]
before_action :set_new_learning_object, only: :index
before_action :authorize!, except: [:create, :tagging, :untagging, :subjecting, :unsubjecting, :add_stages, :remove_stages]
before_action :authorize!, except: [:create, :tagging, :untagging]
def index
learning_objects = paginate LearningObject.includes(:tags, :publisher, :language, :license, :subjects, :educational_stages, :reviews)
......
......@@ -2,6 +2,8 @@ class CollectionPolicy < ApplicationPolicy
include SociablePolicy
include FollowablePolicy
include TaggablePolicy
include SubjectablePolicy
include StageablePolicy
class Scope < Scope
def initialize(user, user_id, scope)
......
......@@ -2,6 +2,8 @@ class LearningObjectPolicy < ApplicationPolicy
include SociablePolicy
include ReportablePolicy
include TaggablePolicy
include SubjectablePolicy
include StageablePolicy
class Scope < Scope
def resolve
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment