2014-11-02 19:44:15 +00:00
|
|
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
|
|
|
class ObjectManagerAttributesController < ApplicationController
|
|
|
|
before_filter :authentication_check
|
|
|
|
|
|
|
|
# GET /object_manager_attributes_list
|
|
|
|
def list
|
2015-02-15 09:12:27 +00:00
|
|
|
return if deny_if_not_role(Z_ROLENAME_ADMIN)
|
2015-04-27 13:42:53 +00:00
|
|
|
render json: {
|
|
|
|
objects: ObjectManager.listFrontendObjects,
|
2014-11-02 19:44:15 +00:00
|
|
|
}
|
|
|
|
#model_index_render(ObjectManager::Attribute, params)
|
|
|
|
end
|
|
|
|
|
|
|
|
# GET /object_manager_attributes
|
|
|
|
def index
|
2015-02-15 09:12:27 +00:00
|
|
|
return if deny_if_not_role(Z_ROLENAME_ADMIN)
|
2015-04-27 13:42:53 +00:00
|
|
|
render json: ObjectManager::Attribute.list_full
|
2014-11-02 19:44:15 +00:00
|
|
|
#model_index_render(ObjectManager::Attribute, params)
|
|
|
|
end
|
|
|
|
|
|
|
|
# GET /object_manager_attributes/1
|
|
|
|
def show
|
2015-02-15 09:12:27 +00:00
|
|
|
return if deny_if_not_role(Z_ROLENAME_ADMIN)
|
2014-11-02 19:44:15 +00:00
|
|
|
model_show_render(ObjectManager::Attribute, params)
|
|
|
|
end
|
|
|
|
|
|
|
|
# POST /object_manager_attributes
|
|
|
|
def create
|
2015-02-15 09:12:27 +00:00
|
|
|
return if deny_if_not_role(Z_ROLENAME_ADMIN)
|
2014-11-02 19:44:15 +00:00
|
|
|
model_create_render(ObjectManager::Attribute, params)
|
|
|
|
end
|
|
|
|
|
|
|
|
# PUT /object_manager_attributes/1
|
|
|
|
def update
|
2015-02-15 09:12:27 +00:00
|
|
|
return if deny_if_not_role(Z_ROLENAME_ADMIN)
|
2014-11-02 19:44:15 +00:00
|
|
|
model_update_render(ObjectManager::Attribute, params)
|
|
|
|
end
|
|
|
|
|
|
|
|
# DELETE /object_manager_attributes/1
|
|
|
|
def destroy
|
2015-02-15 09:12:27 +00:00
|
|
|
return if deny_if_not_role(Z_ROLENAME_ADMIN)
|
2014-11-02 19:44:15 +00:00
|
|
|
model_destory_render(ObjectManager::Attribute, params)
|
|
|
|
end
|
|
|
|
end
|