view · edit · sidebar · attach · print · history

20120428-update-privilege-for-fachinfo-chapters

<< | Index | >>


Summary

  • Added checking of privilege for fachinfo editing
  • Fixed empty link problem
  • Fixed transparent problem for pointer
  • Updated original/generic type handling for package

Commits

Index


Update privilege for editing of fachinfo chapters

allowed only RootUser and AdminUser editing of fachinfo(chapters)

in src/state/drug/fachinfo.rb

  def _has_editor_privilege?
    user = @session.user
    [   
      'org.oddb.RootUser',
      'org.oddb.AdminUser'
    ].each do |priv|
      return true if user.allowed?('login', priv)
    end 
    return false
  end
NOTE
  • ODDB::Session < SBSM::Session
  • SBSM::Session has attr_reader :user
  • @session.user

Fixed empty link problem in fachinfo

ch.oddb> registration('62069')
-> #<ODDB::Registration:0x0000000cd004d8>
ch.oddb> registration('62069').sequence('01')
-> LEV DESITIN 250 mg, Minipacks mit Mini-Filmtabletten
ch.oddb> registration('62069').sequence('01').fachinfo
-> #<ODDB::FachinfoDocument2001:0x0000000d2e9cc8>
ch.oddb> registration('62069').sequence('01').fachinfo.links
-> undefined method `created' for nil:NilClass
ch.oddb>

Moved generic_type from Registration to Package

use sl_generic_type.

ch.oddb> registration('32497').sequence('01').package('012').generic_type
-> 
ch.oddb> registration('32497').sequence('01').package('012').sl_generic_type
-> original
ch.oddb>
NOTE

in Result list (by Package)

  • generic drug is green
  • original drug red
view · edit · sidebar · attach · print · history
Page last modified on April 28, 2012, at 08:04 PM