project BLF > class BUser > business logic query GetUserRoles

Description

This query returns all active roles, linked to a user, in the order of the role sequence.


Parameters


iiUserIdinteger
iiCompanyIdintegerCompany id


query condition


  each Usr where
Usr.Usr_ID = iiUserId

      each UsrRole (inner-join) where
UsrRole.Usr_ID = Usr.Usr_ID AND

          first Role (inner-join) where
Role.Role_ID = UsrRole.Role_ID AND
Role.RoleIsActive = True

          each UsrRoleCompany (outer-join) where
UsrRoleCompany.Company_Id = iiCompanyId AND
UsrRoleCompany.UsrRole_ID = UsrRole.UsrRole_ID AND


query resultset tqGetUserRoles


field namedata typedb fielddescription
tiCompany_IDintegerUsrRoleCompany.Company_IDEntity
tiRole_IDintegerRole.Role_IDRecord ID
tcRoleDescriptioncharacterRole.RoleDescriptionRoleDescription
tcRoleNamecharacterRole.RoleNameRole Name
tiUsr_IDintegerUsr.Usr_IDRecord ID
tcUsrLogincharacterUsr.UsrLoginLogin
tlUsrRoleIsDefaultRolelogicalUsrRole.UsrRoleIsDefaultRoleIndicates the default role per user.


Internal usage


QadFinancials
method MfgNotification.ProcessUsersForCompany