From 7f404c454afc6c546fba6885dbcf409f67a73d0f Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 27 Feb 2013 06:53:20 +0100 Subject: Rights for the call action of a SipAccount. --- app/models/ability.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app') diff --git a/app/models/ability.rb b/app/models/ability.rb index be64528..2e270da 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -169,6 +169,10 @@ class Ability # can :manage, VoicemailMessage can :manage, VoicemailSetting + + # Can initiate a call + # + can :call, SipAccount end end else -- cgit v1.2.3 From 15d5f410afafce67b61a27479a21546cebd48ed9 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 27 Feb 2013 10:23:26 +0100 Subject: Show a restore link in the setup navigation bar. --- app/models/ability.rb | 5 +++++ app/views/layouts/_navbar.html.haml | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/ability.rb b/app/models/ability.rb index 2e270da..23af525 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -90,6 +90,11 @@ class Ability # SIM cards # cannot [:edit, :update], SimCard + + # Restore is only possible on a new system. + # + cannot :manage, RestoreJob + else # Any user can do the following stuff. # diff --git a/app/views/layouts/_navbar.html.haml b/app/views/layouts/_navbar.html.haml index a7f47cf..8004c0e 100644 --- a/app/views/layouts/_navbar.html.haml +++ b/app/views/layouts/_navbar.html.haml @@ -3,10 +3,12 @@ .container %span.hidden-phone %a.brand{:href => (current_user.nil? ? '/' : tenant_path(current_user.current_tenant))} - Gemeinschaft 5 + Gemeinschaft 5.1 .nav-collapse.collapse %ul.nav + - if !GemeinschaftSetup.any? + %li=link_to t('restore_jobs.new.page_title'), new_restore_job_path - if current_user && GemeinschaftSetup.any? && current_user.admin? - if current_page?(page_help_path) %li.active -- cgit v1.2.3 From cf5938150ba3efc38feaf28f9dee6b174893430e Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 27 Feb 2013 10:41:20 +0100 Subject: Delete dupe entry. --- app/models/ability.rb | 4 ---- 1 file changed, 4 deletions(-) (limited to 'app') diff --git a/app/models/ability.rb b/app/models/ability.rb index 23af525..3ba4481 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -174,10 +174,6 @@ class Ability # can :manage, VoicemailMessage can :manage, VoicemailSetting - - # Can initiate a call - # - can :call, SipAccount end end else -- cgit v1.2.3 From 41e17e9f3e184975e8b429d3fb06d822c49068bf Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 27 Feb 2013 10:43:17 +0100 Subject: load_and_authorize_resource :sip_account, :only => [:call] #213 --- app/controllers/sip_accounts_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/sip_accounts_controller.rb b/app/controllers/sip_accounts_controller.rb index ef1aab8..621bd3c 100644 --- a/app/controllers/sip_accounts_controller.rb +++ b/app/controllers/sip_accounts_controller.rb @@ -1,7 +1,7 @@ class SipAccountsController < ApplicationController load_resource :user load_resource :tenant - load_resource :sip_account, :only => [:call] + load_and_authorize_resource :sip_account, :only => [:call] load_and_authorize_resource :sip_account, :through => [:user, :tenant ] before_filter :set_and_authorize_parent -- cgit v1.2.3