using constants instead of literals
This commit is contained in:
parent
591c537325
commit
ac43a0a104
2 changed files with 10 additions and 3 deletions
|
@ -15,19 +15,19 @@ class TicketStatesController < ApplicationController
|
||||||
|
|
||||||
# POST /ticket_states
|
# POST /ticket_states
|
||||||
def create
|
def create
|
||||||
return if deny_if_not_role('Admin')
|
return if deny_if_not_role(Z_ROLENAME_ADMIN)
|
||||||
model_create_render(Ticket::State, params)
|
model_create_render(Ticket::State, params)
|
||||||
end
|
end
|
||||||
|
|
||||||
# PUT /ticket_states/1
|
# PUT /ticket_states/1
|
||||||
def update
|
def update
|
||||||
return if deny_if_not_role('Admin')
|
return if deny_if_not_role(Z_ROLENAME_ADMIN)
|
||||||
model_update_render(Ticket::State, params)
|
model_update_render(Ticket::State, params)
|
||||||
end
|
end
|
||||||
|
|
||||||
# DELETE /ticket_states/1
|
# DELETE /ticket_states/1
|
||||||
def destroy
|
def destroy
|
||||||
return if deny_if_not_role('Admin')
|
return if deny_if_not_role(Z_ROLENAME_ADMIN)
|
||||||
model_destory_render(Ticket::State, params)
|
model_destory_render(Ticket::State, params)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
7
config/initializers/zammad_constants.rb
Normal file
7
config/initializers/zammad_constants.rb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# Copyright (C) 2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
|
# Prefix all zammad constants w/ Z_
|
||||||
|
|
||||||
|
# Prefix all rolenames with Z_ROLENAME
|
||||||
|
Z_ROLENAME_ADMIN = 'Admin'
|
||||||
|
|
Loading…
Reference in a new issue