WCF Cache Service methods parameters

Topics: WCF Cache Service
Jul 18, 2011 at 9:02 AM

First i would like to thank the team for such a great job.

I have some questions on CheckAccessForDatabaseUsersWithAttributesRetrieve(...) method parameters.

Quote with my comments where i have the trouble from documentation:

Parameters

attributes
Type: array<System.Collections.Generic..::..KeyValuePair<(Of <(<'String, String>)>)>>[]()[][]%
The attributes.  //What attributes it means?
storeName
Type: System..::..String
Name of the store. //Here is clear
applicationName
Type: System..::..String
Name of the application. //Here is clear
itemName
Type: System..::..String
Name of the item. //What item, operation/task on which to check access?
DBuserSSid
Type: System..::..String
The Db user S sid. //How i can obtain a database user ssid, and why it needs it, if i put the connectionString in the config of wcf cache service?
validFor
Type: System..::..DateTime
The valid for. //What is this, the date when the user is valid?
operationsOnly
Type: System..::..Boolean
if set to true [operations only]. //If is set to true it will doesn't check access for task, only for operations?
contextParameters
Type: array<System.Collections.Generic..::..KeyValuePair<(Of <(<'String, Object>)>)>>[]()[][]
The context parameters. // Not clear

Please correct me, and make clear what is unclear.
Thanks in advance. 

Jul 18, 2011 at 5:58 PM

I’ll answer inline.

Parameters

attributes

Type: array<System.Collections.Generic..::..KeyValuePair<(Of <(<'String, String>)>)>>[]()[][]%
The attributes.
//What attributes it means? This is an out parameter and returns all the attribute couples you have setted by the console (see the guide).

storeName

Type: System..::..String
Name of the store. //Here is clear

applicationName

Type: System..::..String
Name of the application. //Here is clear

itemName

Type: System..::..String
Name of the item. //What item, operation/task on which to check access? Exactly, this is the name of the Role/Task/Operation.

DBuserSSid

Type: System..::..String
The Db user S sid. //How i can obtain a database user ssid, and why it needs it, if i put the connectionString in the config of wcf cache service? This is the user for which you are checking the access and not the user used to connect to SQL Server DB.

validFor

Type: System..::..DateTime
The valid for. //What is this, the date when the user is valid? Each permission can be setted for a time range … if you set a time range validity … when you check the access you can pass in for which time you are checking.

operationsOnly

Type: System..::..Boolean
if set to true [operations only]. //If is set to true it will doesn't check access for task, only for operations? Exactly.

contextParameters

Type: array<System.Collections.Generic..::..KeyValuePair<(Of <(<'String, Object>)>)>>[]()[][]
The context parameters. // Not clearContext Parameters must be passed in only if you use Business Rules … otherwise pass null (see the NetSqlAzMan guide for further details).

Regards,

Andrea.

__________________________________
Andrea Ferendeles
NetSqlAzMan Project Coordinator
E-mail aferende@hotmail.com Web http://netsqlazman.codeplex.com

Jul 28, 2011 at 3:08 PM
Edited Jul 28, 2011 at 3:42 PM

 

When i invoke cache service's method to check access for database user, i always receive NEUTRAL.

 

 
var authType = (csc.CheckAccessForDatabaseUsersWithoutAttributesRetrieve(ConfigurationManager.AppSettings["SecStoreName"], &#65533;ConfigurationManager.AppSettings["SecApplicationName"], &#65533;operation, SPA.Enterprise.Host.Program.UserName, &#65533;DateTime.Now, false, null));

When i do this for windows users all work perfect, with db users authType is always Neutral. I have doubts, when i pass the username to check for access, it shouldn't be crypted (e.g. Administrator, John )? 
I added  my user to Administrators role, and added my task, to Administrators role task list and no effect.
Thx for spending time developing free, open source programs .
    <add key="expirationValue" value="0 0 0 0"/> //how i set the expiration date
EDIT:
I tried to put the user Custom SID(e.g. 00000005) instead of username and it works, but how to retrieve this Custom SID? I saw that Custom SID, is the id of user in 8 digits at the end of number, but if id is 10, there is 0000000A.

Jul 29, 2011 at 7:43 AM

Hi,

this method expect the User SID … and not the User Name.

Check “UserID” column of the “dbo.UsersDemo” table.

Remember also to “Invalidate” the WCF Service Cache …before invoking check access methods (right click on the console root node – Invalidate WCF Cache Service”).

Regards,

Andrea.

__________________________________
Andrea Ferendeles
NetSqlAzMan Project Coordinator
E-mail aferende@hotmail.com Web http://netsqlazman.codeplex.com