Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.56 KB | None | 0 0
  1.  null_rules, is_upr, ruls_dep = get_rules_by_view_mode()
  2.         if null_rules:
  3.             return None if self.ret_pos is True else []
  4.  
  5.         if contr is not None:
  6.             is_upr = True if str(contr) == '-2' else False
  7.  
  8.         if is_upr is True:
  9.             # ищем только по подразделению
  10.             if dep_pos is not None:
  11.                 if ruls_dep is None:  # все разрешено
  12.                     ruls_dep = '[' + str(dep_pos) + ']'
  13.                 elif str(dep_pos) in ruls_dep:  # разрешено часть и текущее входитв разрещенные
  14.                     ruls_dep = '[' + str(dep_pos) + ']'
  15.                 else:
  16.                     return None if self.ret_pos is True else []
  17.         else:
  18.             if dep_pos is not None:
  19.                 if ruls_dep is None:  # все разрешено
  20.                     ruls_dep = '[' + str(dep_pos) + ']'
  21.                 elif str(dep_pos) in ruls_dep:  # разрешено часть и текущее входитв разрещенные
  22.                     ruls_dep = '[' + str(dep_pos) + ']'
  23.                 else:
  24.                     return None if self.ret_pos is True else []
  25.             elif contr is not None and str(contr) != '-1':
  26.                 if ruls_dep is None:  # все разрешено
  27.                     ruls_dep = '[' + str(contr) + ']'
  28.                 elif str(contr) in ruls_dep:  # разрешено часть и текущее входитв разрещенные
  29.                     ruls_dep = '[' + str(contr) + ']'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement