_Can-read and domains

Posted by Riverside Software on 12-May-2015 08:36

Hello all,

Is it possible to use the syntax user@domain in _can-* fields ?

I've setup a sports2000 db and not able to make it work, but I'm wondering if I'm doing anything wrong.


Gilles

All Replies

Posted by Peter Judge on 12-May-2015 08:41

Yes, you should be able to do that.
 
[collapse]
From: Riverside Software [mailto:bounce-rssw@community.progress.com]
Sent: Tuesday, 12 May, 2015 09:37
To: TU.OE.General@community.progress.com
Subject: [Technical Users - OE General] _Can-read and domains
 
Thread created by Riverside Software

Hello all,

Is it possible to use the syntax user@domain in _can-* fields ?

I've setup a sports2000 db and not able to make it work, but I'm wondering if I'm doing anything wrong.


Gilles

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Mike Fechner on 12-May-2015 08:46

I thought that was the whole point in the behavior change in the CAN-DO function.
 

Posted by Tim Kuehn on 12-May-2015 09:02

It depends on what version you're running (pre or post 11.0), and if the "use the old behavior" client flag is set or not.

[collapse]
On Tue, May 12, 2015 at 9:46 AM, Mike Fechner <bounce-mikefechner@community.progress.com> wrote:
Reply by Mike Fechner
I thought that was the whole point in the behavior change in the CAN-DO function.
 

Stop receiving emails on this subject.

Flag this post as spam/abuse.




--
Tim Kuehn:  Senior Consultant  - TDK Consulting Services
President - Ontario PUG 
Program Committee Chair - PUG Challenge Americas, 
Course Instructor: Intro to OO Concepts for Procedural Programmers

Skype: timothy.kuehn
Ph: 519-576-8100
Cell: 519-781-0081
[/collapse]

Posted by Michael Jacobs on 12-May-2015 09:15

Mike is correct, it is the whole point.  
The CAN-DO function executes precisely the same code as the database connection's permission checking so you can see some pattern examples in the ABL reference manual.   The difference is that with CAN-DO the application supplies the values and with database permission checking it uses the connection's Client-Principal user-id & domain and the table/field's permission field value.

Mike J.

[collapse]
From: Mike Fechner <bounce-mikefechner@community.progress.com>
Reply-To: "TU.OE.General@community.progress.com" <TU.OE.General@community.progress.com>
Date: Tuesday, May 12, 2015 at 9:46 AM
To: "TU.OE.General@community.progress.com" <TU.OE.General@community.progress.com>
Subject: [Technical Users - OE General] AW: _Can-read and domains

Reply by Mike Fechner
I thought that was the whole point in the behavior change in the CAN-DO function.
 

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Riverside Software on 12-May-2015 10:24

My simple test (11.5 Linux) :

* Create sports2000 DB

* Add a domain based on _oeusertable, and a record in _user table with this domain

* Set _can-read = "!,!MyUser@MyDomain,*' for table Benefits

* Turned on runtime security

* Connect the DB (either with -U -P or with set-db-client) with this account, and execute for each benefits : I'm able to read Benefits account.

* If I change to _can-read to "!,!MyUser,*", then I'm not able to read the table...

Trying can-do(_File._Can-Read) also says 'yes' (with _file buffer pointing to the Benefits record). If I execute can-do(_File._can-read, hCP:qualified-user-id), then I get a 'no'. Documentation says that userid with a non multi-tenancy db return a non-qualified userid. Could it be the problem ? Or am I missing something ?

Gilles

Posted by Aidan Jeffery on 12-May-2015 11:48

Are you compiling your code and running r-code when reconnecting to the database?

Posted by Riverside Software on 12-May-2015 11:53

No, running directly from source, and also why I've turned runtime security on. Note that when I switch from "!,!MyUser@MyDomain,*" to "!,!MyUser,*", then the result is immediately available (access or no access to the records).

Posted by Fernando Souza on 12-May-2015 12:24

Actually you are seeing is actually the documented behavior. There is more information in the "Identity Management" book, under the “Non-multi-tenant vs. multi-tenant authorization” and “When a user's domain is available for access control” sections.

The behavior you see is for backwards compatibility.

You should define only the user name in the _Can-* fields, for a non-multi-tenant database. And there is no option for enabling full domain authorization in that case.

Posted by Riverside Software on 12-May-2015 12:34

Thanks Fernando.

So the outcome is that there's no way to define authorizations using domains on a non-MT database ? Or is there an option to turn off backward compatibility ?

Posted by Tim Kuehn on 12-May-2015 12:54

I thought user@domain was the "new default", since Progress's added a -nocanddodomain client parameter which turns off user@domain processing for can-do(). (See the 11.5 Startup Command and Reference docs)

[collapse]
On Tue, May 12, 2015 at 1:35 PM, Riverside Software <bounce-rssw@community.progress.com> wrote:
Reply by Riverside Software

Thanks Fernando.

So the outcome is that there's no way to define authorizations using domains on a non-MT database ? Or is there an option to turn off backward compatibility ?

Stop receiving emails on this subject.

Flag this post as spam/abuse.




--
Tim Kuehn:  Senior Consultant  - TDK Consulting Services
President - Ontario PUG 
Program Committee Chair - PUG Challenge Americas, 
Course Instructor: Intro to OO Concepts for Procedural Programmers

Skype: timothy.kuehn
Ph: 519-576-8100
Cell: 519-781-0081
[/collapse]

Posted by Michael Jacobs on 12-May-2015 13:02

Tim,
Where the DB's multi-tenant license is the key to controlling the full domain authorization checking for table/field permissions - the -nocandodomain controls full domain authorization checking in CAN-DO() [for table/field permissions].

Mike J.

[collapse]
From: Tim Kuehn <bounce-timk519@community.progress.com>
Reply-To: "TU.OE.General@community.progress.com" <TU.OE.General@community.progress.com>
Date: Tuesday, May 12, 2015 at 1:55 PM
To: "TU.OE.General@community.progress.com" <TU.OE.General@community.progress.com>
Subject: Re: [Technical Users - OE General] _Can-read and domains

Reply by Tim Kuehn
I thought user@domain was the "new default", since Progress's added a -nocanddodomain client parameter which turns off user@domain processing for can-do(). (See the 11.5 Startup Command and Reference docs)

[collapse]
On Tue, May 12, 2015 at 1:35 PM, Riverside Software <bounce-rssw@community.progress.com> wrote:
Reply by Riverside Software

Thanks Fernando.

So the outcome is that there's no way to define authorizations using domains on a non-MT database ? Or is there an option to turn off backward compatibility ?

Stop receiving emails on this subject.

Flag this post as spam/abuse.




--
Tim Kuehn:  Senior Consultant  - TDK Consulting Services
President - Ontario PUG 
Program Committee Chair - PUG Challenge Americas, 
Course Instructor: Intro to OO Concepts for Procedural Programmers

Skype: timothy.kuehn
Ph: 519-576-8100
Cell: 519-781-0081
Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse][/collapse]

Posted by Fernando Souza on 12-May-2015 13:52

No, there is no option for turning off backwards compatibility on this.

This thread is closed