T
Timothy Parez
Hello,
We have a small sized database (22 tables) on a Microsoft SQL Server.
We would like to use a WebService to manage all access to that database,
enforcing a custom security scheme and thin clients.
(The clients will be SWF, GTK# and SWF-PocketPC applications)
I'm having trouble defining the methods I need, but currently I have
something like this:
* ADOBJECT */
[WebMethod(Description="Get a list of all ADOBJECT record")]
public DataSet GetAdObjects()
{
/* Security:
* Administrators, Publishers, Readers, PowerUsers */
eGroup group = this.GetUserGroup();
if (group != eGroup.None)
{
return this.GetDataSet("SELECT * FROM
ADOBJECT","ADOBJECT",null);
}
else
{
this.throwAccessDeniedException("GetAdObjects()",String.Empty);
return null;
}
}
/* ADOBJECTTYPE */
[WebMethod(Description="Get a list of all ADOBJECTTYPE records")]
public DataSet GetAdObjectTypes()
{
/* Security:
* Administrators, Publishers, Readers, PowerUsers */
eGroup group = this.GetUserGroup();
if (group != eGroup.None)
{
return this.GetDataSet("SELECT * FROM
ADOBJECTTYPE","ADOBJECTTYPE",null);
}
else
{
this.throwAccessDeniedException("GetAdObjectTypes()",
String.Empty);
return null;
}
}
I have GetX() methods like this for every table in our database,
and I apply a custom security scheme here.
These methods return a dataset, which the client then filters.
I don't allow the client to execute SQL for security reasons.
Is this a good approuch ? And how shall I go about linkage tables and adding
or updating data.
Thnx.
We have a small sized database (22 tables) on a Microsoft SQL Server.
We would like to use a WebService to manage all access to that database,
enforcing a custom security scheme and thin clients.
(The clients will be SWF, GTK# and SWF-PocketPC applications)
I'm having trouble defining the methods I need, but currently I have
something like this:
* ADOBJECT */
[WebMethod(Description="Get a list of all ADOBJECT record")]
public DataSet GetAdObjects()
{
/* Security:
* Administrators, Publishers, Readers, PowerUsers */
eGroup group = this.GetUserGroup();
if (group != eGroup.None)
{
return this.GetDataSet("SELECT * FROM
ADOBJECT","ADOBJECT",null);
}
else
{
this.throwAccessDeniedException("GetAdObjects()",String.Empty);
return null;
}
}
/* ADOBJECTTYPE */
[WebMethod(Description="Get a list of all ADOBJECTTYPE records")]
public DataSet GetAdObjectTypes()
{
/* Security:
* Administrators, Publishers, Readers, PowerUsers */
eGroup group = this.GetUserGroup();
if (group != eGroup.None)
{
return this.GetDataSet("SELECT * FROM
ADOBJECTTYPE","ADOBJECTTYPE",null);
}
else
{
this.throwAccessDeniedException("GetAdObjectTypes()",
String.Empty);
return null;
}
}
I have GetX() methods like this for every table in our database,
and I apply a custom security scheme here.
These methods return a dataset, which the client then filters.
I don't allow the client to execute SQL for security reasons.
Is this a good approuch ? And how shall I go about linkage tables and adding
or updating data.
Thnx.