This topic is locked

Another search gotcha...

8/8/2005 2:32:58 PM
ASPRunnerPro General questions
sparkg author

I have master table of records with one column called Company.

I have a table of users with Username, Password and Company columns.
I've set it up between the two linked Company columns that a user can only see and edit his own records by company. This works fine.
However, when I simple or advanced search column Company for a different company than the one I'm logged in with, I get records from other companies...I should come up with no records, restricted by that logged in Company field.
This is different than my previous question below where we wanted to open with a subset of Open or New records and then search for Closed records. Records should be restricted at all times at the user level.
Is there another way to do this? Or can you fix?
Thanks!

Sergey Kornilov admin 8/9/2005

Hi,
to restrict advanced search by Company that logged user belongs to you need to set up Advanced security for Company table.
Choose Company table on the Datasource table (Step3) in ASPRunner and proceed to Securitytab (Step10).

Choose Username and password from database option and set Table:Users, Username field:Username, Password field:Password.
Click Advanced... button and choose Users can see and edit their own data onlyoption and set Companyfield as User Table/Main Table:OwnerID field.

sparkg author 8/9/2005

I did all that...but...
I don't have a Company table, I have a Users table with 3 columns:

Username, Password, and Company.
Then I have a main table. It also has a column called Company.
I went through the advanced security and linked the 2 company columns so that when you open the main table, you only see and edit your own companies records. This works fine.
The problem is, if you search or advanced search for another company in the main table, the other companies records show up, it's not restricted by the company/company security setting.
Maybe I'm using that feature wrong.

Sergey Kornilov admin 8/10/2005

Hi,
this scheme should work for Advanced search, no matter how your table is named.
Please zip and send to support@xlinesoft.com your project file along with

your database creation script or database itself for investigation.

sparkg author 8/10/2005

I will make a sample for you, the solution is running on MS iis server.

Thanks Sergey.