This topic is locked

Security Question.

4/26/2011 7:49:56 PM
ASPRunnerPro General questions
R
Roger author

Good day. I have the following scenario:

Table 1(PK: AcctNo), datatype: bigint

Table 2(PK:recno,IDX:acctno), datatype: bigint
Table2 -> Table1 via acctno. I've done this many times and it works fine. Many Table2 to 1 Table1
However, in this case, I set the relationship in the table picker ([User Table] T1.acctno -> [Owner Table] T2.acctno). That works fine, but when I go to the Security Setting and try to change it to "Users can see and edit their own data), I cannot select the column acctno for the Owner Table (T2). It doesn't display anything other than text fields, not even the PK (recno).
As mentioned, this works fine for any/all other tables, but not this one.
I've even created a new blank project and the same thing. MY DB schema and tables are correct - this I've checked over and over.
What am I doing missing (ok fair enuff that's a loaded question), I haven't been in here for quite some time and am obviousy missing something,
Thanks, Roger

Sergey Kornilov admin 4/27/2011

You cannot use the same field as a foreign key (master-details) and as an OwnerID. Add a new field to T2 for this purpose.

R
Roger author 4/27/2011



You cannot use the same field as a foreign key (master-details) and as an OwnerID. Add a new field to T2 for this purpose.



You see, that's why this is such a valuable forum, cause I did not know this. Anywway, now I think I'm confused - no surprise here. A little more detail may help me to understand what you are telling me:

  1. The Master table has a PK called acctno - bigint,
  2. The details table has an IDX field called acctno - bigint,
  3. In the table picker, I've related table1 to table2 on acctno (1:many). So acctno in t2 is not a pk, just an index.
    So how would I do this so that I can maintain this structure? The only relevant data between the two tables is acctno. It would make no sense to add another column to enforce security - in particular when we want to use acctno to show the relationship between them and use the same column for security enforement. We need the relationship as defined in the table picker, as well as the same column for secrity enforcement.
    In another project what we developed some time ago, we have the following:
  4. Table1, acctno (pk) - bigint,
  5. Table2 (3 & 4) (recno: pk, acctno :idx). Another column in each of T2-T4 is a pk, but not used in any picker or security relationships,
  6. In the table picker we have T1.acctno -> t2(3 & 4).acctno . So those are the Link Fields,
  7. In the security section, we have (Usertable:ownerid) as T1.acctno and (Maintable:ownerid) as T2.acctno (I can send snapshots of this setup). These of course are the related fields.
    It works just fine.
    So back to me being dazed, confused and probably missing something, but I cant' see it.
    Thanks a bunch for the help.

Sergey Kornilov admin 4/27/2011

You are trying to make T2.acctno field store two different values at the same time (primary key from T1 table and OwnerID from the login table). These two values are different and you need two fields for this purpose.
Think two cellular phones. Each phone requires its own pocket. You need two pockets, right?

R
Roger author 4/27/2011



You are trying to make T2.acctno field store two different values at the same time (primary key from T1 table and OwnerID from the login table). These two values are different and you need two fields for this purpose.
Think two cellular phones. Each phone requires its own pocket. You need two pockets, right?



Great analogy and thank you, this does make perfect sense. So now I have the question of how I have another project doing exactly what I mentioned, i.e. using the same column in both places?
I can send along snaps to show you how I have it setup and it does work, maybe there is something that I am just not seeing. But I swear, it is setup as mentioned in my previous posts.
Thanks again for the tme and patience with this - it is a bizaar one to me.

Sergey Kornilov admin 4/28/2011

I recommend to double-check settings in your other projects. Even if you are able to setup it this way (i.e. adding advanced security first and master-details second) it still won't work properly as you still need two fields to store two different values.

R
Roger author 4/28/2011



I recommend to double-check settings in your other projects. Even if you are able to setup it this way (i.e. adding advanced security first and master-details second) it still won't work properly as you still need two fields to store two different values.



You bet, I'll have one of our developers look at it. It has been working for over a year, I'll certainlly get back to this forum asap (probably tomorrow).
Thanks again. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=57930&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

R
Roger author 4/28/2011



You bet, I'll have one of our developers look at it. It has been working for over a year, I'll certainlly get back to this forum asap (probably tomorrow).
Thanks again. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=57941&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />



Okay, so we checked and checked and yes the configuration is as I've stated. I have two snaps that show the configuration we are using.
How can I send them to you? Our concern is if this works in our app (and it's not supposed to), then we may be in for a world of hurt in the future and would need to address this sooner than later.
Please advise, thanks again.
Concerned Roger...

Sergey Kornilov admin 4/28/2011

Roger,
sure, contact support sending those snapshots. It will be helpful if you also post your old application to demo account so we have a full picture.