Advertisement
dandepp

Untitled

Mar 27th, 2023
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.02 KB | None | 0 0
  1. PROCEDURE getUserPermissions()
  2. response is array of MPermisos = Projecte_Service.permisos.GetAllByUserID(LOOP_PermisosEmpleats.ATT_Codi)
  3.  
  4. IF response.Count >= 1 THEN
  5.     currentPermissions.DeleteAll()
  6.     FOR EACH elem OF response
  7.         index is int = LooperSearchEverywhere(LOOP_ArrayPermisos, elem.NOM, searchExactMatch)
  8.         IF index <> -1 THEN
  9.             LOOP_ArrayPermisos[index].CBOX_CheckedRow = True
  10.             currentPermissions.Add(elem.PERMISOS_ID)   
  11.         END            
  12.     END
  13. END
  14.  
  15. PROCEDURE getUserRoles()
  16. //send req to get all roles associated with the selected user
  17. response is array of MRoles = Projecte_Service.roles.GetAllByUserID(LOOP_RolsEmpleats.ATT_Codi)
  18.  
  19. //if response contains data
  20. IF response.Count >= 1 THEN
  21.     currentRoles.DeleteAll()
  22.     FOR EACH elem OF response
  23.         index is int = LooperSearchEverywhere(LOOP_ArrayRoles, elem.NOM, searchExactMatch)
  24.         IF index <> -1                  THEN
  25.             LOOP_ArrayRoles[index].CBOX_CheckedRow = True
  26.             currentRoles.Add(elem.ROLES_ID)
  27.         END
  28.     END
  29. END
  30. //get associations
  31. Projecte_Service.roles.getAllRolesAss()
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement