Class: Auth
- Inherits:
-
Object
- Object
- Auth
- Defined in:
- lib/auth.rb
Overview
Class to handle authorization related SAP information
Class Method Summary collapse
-
.for_object(*options) ⇒ Array
Return a list of users with authorization for an object.
-
.profiles_for_composite(conn, list = []) ⇒ Object
Select Authorization roles for the Profile.
Class Method Details
.for_object(*options) ⇒ Array
Return a list of users with authorization for an object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/auth.rb', line 10 def self.for_object(*) users = [] conn, obj, field1, value1, field2, value2 = () return users unless conn && obj ## Busca o AUTH na tabela UST12 ust12_list = Auth.auth_list(conn, obj, field1, value1, field2, value2) return users unless ust12_list ## Busca o PROFN na tabela UST10S ust10s_list = Auth.profile_list(conn, obj, ust12_list) ## Busca os Usuários na tabela UST04 Auth.user_list(conn, obj, ust10s_list) end |
.profiles_for_composite(conn, list = []) ⇒ Object
Select Authorization roles for the Profile
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/auth.rb', line 30 def self.profiles_for_composite(conn, list = []) return [] if list.empty? fname = conn.conn.get_function('SIAG_PROF_GET_AUTH') fcall = fname.get_function_call fcall[:IV_PROFILE_TYPE] = 'C' list.each do |prof| row = fcall[:IT_PROFILE_RANGE].new_row row[:SIGN] = 'I' row[:OPTION] = 'EQ' row[:LOW] = prof end fcall.invoke ret = [] fcall[:ET_COMPOSITE_PROFILE].each do |row| ret.push(row[:SINGLE_PROFILE]) end ret end |