diff options
Diffstat (limited to 'lib/stif')
| -rw-r--r-- | lib/stif/my_workbench_scopes.rb | 32 | 
1 files changed, 17 insertions, 15 deletions
diff --git a/lib/stif/my_workbench_scopes.rb b/lib/stif/my_workbench_scopes.rb index 7e4500a7d..89c4e659c 100644 --- a/lib/stif/my_workbench_scopes.rb +++ b/lib/stif/my_workbench_scopes.rb @@ -1,21 +1,23 @@ -class Stif::MyWorkbenchScopes -  attr_accessor :workbench +module Stif +  class MyWorkbenchScopes +    attr_accessor :workbench -  def initialize(workbench) -    @workbench = workbench -  end +    def initialize(workbench) +      @workbench = workbench +    end -  def line_scope(initial_scope) -    ids = self.parse_functional_scope -    ids ? initial_scope.where(objectid: ids) : initial_scope -  end +    def line_scope(initial_scope) +      ids = self.parse_functional_scope +      ids ? initial_scope.where(objectid: ids) : initial_scope +    end -  def parse_functional_scope -    return false unless @workbench.organisation.sso_attributes -    begin -      JSON.parse @workbench.organisation.sso_attributes['functional_scope'] -    rescue Exception => e -      Rails.logger.error "MyWorkbenchScopes : #{e}" +    def parse_functional_scope +      return false unless @workbench.organisation.sso_attributes +      begin +        JSON.parse @workbench.organisation.sso_attributes['functional_scope'] +      rescue Exception => e +        Rails.logger.error "MyWorkbenchScopes : #{e}" +      end      end    end  end  | 
