Well first you need to figure out where you’re going to store, or where you already store each User’s access levels.
Once you do that, you need to make sure to tie it into the users BO Login ID.
So that you can end up with a table/view similar to
User Name, User BOBJ Login ID, Account Number
Mr. Smith, MSmith, A
Mr. Smith, MSmith, B
Mr. Jones, MJones, A
Mr. Jones, MJones, C
etc…
Then in your universe, create a derived table something like:
Select * From AccountInformationDetail a
JOIN UserSecurityTable b on a.AccountNumber = b.accountNumber
WHERE b.UserLoginID = @BOUser()
I may have that syntax not 100% but the idea is to take your data table, join it with your security table and only pull data where the account ID matches the user’s account. @BOUser will return ‘MJones’ or 'Msmith" etc…
From there, create any object you want from that derived table and it will automatically only return results where the user has rights to see data.
If you also need objects from ALL the data, just build those objects from a seperate table which does not have the join with BOUser.
Note: on Large tables this can GREATLY increase your query time, especially if your indexes/partitions are not set up correctly in the database. I highly recommend you find a way to make sure the Account ID can be tied to a numeric value (Foreign key reference perhaps) instead of text as that should speed up the join considerably.
Good luck.
JPetlev (BOB member since 2006-11-01)