Advertisement
EddyCZ

Untitled

Nov 30th, 2023
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. @DbViewRowLevelSecurity NotRequired
  2. @Overtake Core
  3. VIEW Project_Access_On_Act_Level IS
  4. SELECT sp.project_id project_id,
  5. sp.sub_project_id sub_project_id,
  6. a.activity_seq activity_seq,
  7. a.rowid objid
  8. FROM SUB_PROJECT_TAB sp, ACTIVITY_TAB a
  9. WHERE a.project_id = sp.project_id
  10. AND a.sub_project_id = sp.sub_project_id
  11. AND a.node_type = 'ACTIVITY'
  12. AND ((EXISTS (SELECT 1 FROM PROJECT_TAB P
  13. WHERE p.access_on_off = 0
  14. AND p.project_id = sp.project_id))
  15. OR (EXISTS (SELECT 1 FROM Fnd_Session f
  16. WHERE f.Fnd_user = FND_SESSION_API.Get_App_Owner))
  17. OR (EXISTS (SELECT 1 FROM Fnd_Session f, Project_tab p, Person_Info_tab pi
  18. WHERE p.access_on_off = 1
  19. AND p.project_id = sp.project_id
  20. AND pi.person_id = p.manager
  21. AND pi.user_id = F.Fnd_User))
  22. OR (EXISTS (SELECT 1 FROM Fnd_Session f, project_access_person_tab pap, person_info_tab pi
  23. WHERE pi.user_id = f.Fnd_User
  24. AND pap.person_id = pi.person_id
  25. AND pap.project_id = sp.project_id
  26. AND pap.sub_project_id = sp.sub_project_id))
  27. OR (EXISTS (SELECT 1 FROM Fnd_Session f, project_access_team_tab pat, person_info_tab pi, team_member_tab tm
  28. WHERE pi.user_id = f.Fnd_User
  29. AND pat.project_id = sp.project_id
  30. AND pat.sub_project_id = sp.sub_project_id
  31. AND pat.team_id = tm.team_id
  32. AND tm.person_id = pi.person_id))
  33. OR (EXISTS (SELECT 1 FROM Fnd_Session f, project_access_team_tab pat, person_info_tab pi, company_emp_tab ce, team_member_tab tm
  34. WHERE pi.user_id = f.Fnd_User
  35. AND pat.project_id = sp.project_id
  36. AND pat.sub_project_id = sp.sub_project_id
  37. AND pat.team_id = tm.team_id
  38. AND ce.company = tm.company
  39. AND tm.employee_id = '%'
  40. AND ce.person_id = pi.person_id))
  41. OR (EXISTS (SELECT 1 FROM Fnd_Session f, project_access_team_tab pat, person_info_tab pi, company_emp_tab ce, team_member_tab tm
  42. WHERE pi.user_id = f.Fnd_User
  43. AND pat.project_id = sp.project_id
  44. AND pat.sub_project_id = sp.sub_project_id
  45. AND pat.team_id = tm.team_id
  46. AND ce.company = tm.company
  47. AND tm.employee_id = '%'
  48. AND ce.person_id = pi.person_id))
  49. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement