home made security sql problem.

home made security sql problem.

Post by News Houn » Fri, 08 Nov 2002 23:36:20



Hi here is a problem I have that I need some help on ... the talbes are defined below

1) the categories table consist of a bunch of document categories
2) the categories_security table consist of which categories are restricted to which groups of people
3) the documents table consist of a bunch of documents
4) the documents_security table consist of which documents are restricted to which groups of people

What I would like to happen is this
1) when a new category is inserted it inherits the security attributes of its immediate parent category
2) when a new document is inserted it inherits the security attributes of the category it is assigned too
3) when a category is updated it passes its updated secuity attributes to its immediate children categories (who in turn should pass them to their children and then their children to their children and so on....)
4) when a category is update it passes its security attributes to the documents immediately with in it

I've attempted this from within the SPs where I insert and update docs and cats and then trying with triggers on the security tables to attempt something like recursion Its not working.

Does anyone know how to accomplish this task?

Thanks.

-----------------   BEGIN TABLEs DEFN --------------------
CREATE TABLE [dbo].[carsdb_document_management_categories] (
 [autoid] [int] IDENTITY (1, 1) NOT NULL ,
 [CategoryID] [nvarchar] (50) NOT NULL ,
 [Category] [nvarchar] (100) NULL ,
 [ParentID] [nvarchar] (50) NULL ,
 [Leaf] [bit] NULL ,
 [posterid] [nvarchar] (50) NULL ,
 [disabled] [bit] NULL ,
 [sortorder] [int] NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[carsdb_document_management_categories_security] (
 [autoid] [int] IDENTITY (1, 1) NOT NULL ,
 [catgid] [nvarchar] (50) NOT NULL ,
 [categoryid] [nvarchar] (50) NULL ,
 [groupid] [nvarchar] (50) NULL ,
 [posterid] [nvarchar] (50) NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[carsdb_document_management_document_security] (
 [autoid] [int] IDENTITY (1, 1) NOT NULL ,
 [datgid] [nvarchar] (50) NOT NULL ,
 [documentid] [nvarchar] (50) NULL ,
 [groupid] [nvarchar] (50) NULL ,
 [posterid] [nvarchar] (50) NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[carsdb_document_management_documents] (
 [autoid] [int] IDENTITY (1, 1) NOT NULL ,
 [documentid] [nvarchar] (50) NOT NULL ,
 [posterid] [nvarchar] (50) NULL ,
 [documenttitle] [nvarchar] (150) NULL ,
 [filename] [nvarchar] (255) NULL ,
 [description] [nvarchar] (4000) NULL ,
 [keywords] [nvarchar] (1000) NULL ,
 [highlight] [bit] NULL ,
 [inline] [bit] NULL ,
 [filelocation] [nvarchar] (255) NULL ,
 [filesize] [float] NULL ,
 [filecontenttype] [nvarchar] (50) NULL ,
 [disabled] [bit] NULL ,
 [categoryid] [nvarchar] (50) NULL ,
 [da*tered] [datetime] NULL ,
 [sponsoredby] [nvarchar] (500) NULL
) ON [PRIMARY]
GO

-----------------   END TABLEs DEFN --------------------

 
 
 

1. Reposition with home-made button - Problem

When I use the code underneath - No problems until I come too far either
ways.

Private Sub Command1_Click()
With Rs
    If .BOF Then Command1.Visible = False
    If Not .BOF Then .MovePrevious
    Read_In    'Reads the currently record in the form (works nice)
  End With
End Sub

Private Sub Command2_Click()
With Rs
    If .EOF Then Command2.Visible = False
    If Not .EOF Then .MoveNext
    Read_In    'Reads the currently record in the form (works nice)
  End With
End Sub

...
I would like to 'trap' the error: 3021 (No record ...) before it occure.
Like dissable the button, so the user will not be able to press the button.
Any ideas.
Thanks in advance
regards, Lennart

2. Interested In Listing Properties On WWW Real Estate Finder?

3. Home-Made GUI

4. snap-in failed to initialize and Application failed to initialize(0xc0000142

5. PRESS HOME DEPOT MAKES MULTI-MILLION DOLLAR PURCHASE OF INFORMIX DATABASE PRODUCTS

6. Sybase ODBC Stored Procedure/VB Problem

7. "home-made" navigation

8. Parameterized Queries and database compatibility.

9. Making Dynamic Dimension Security work

10. Security - Tracking a not allowed select made

11. FROM PROBLEMS IN THE SCHOOL TO PROBLEMS IN THE HOME

12. FREE HOME BUSINESS FREE HOME BUSINESS

13. problem making SQL call in visual interdev