How to specify names of pages inside table for each user type to be accessible inside application?

I'm using SQL Server and a C# Webforms application.

Inside a table, I want to specify usergroup and in front of each group names of accessible pages.

So inside the web application, I search inside masterpage using stored procedure if each entered webform if user can access it or not.

1 answer

  • answered 2017-06-17 19:39 IngoB

    You could create a table like so:

    create table UserGroupToPage
    (
        Id int identity(1, 1) primary key,
        PageName varchar(100) not null,
        UserGroupId int not null foreign key references UserGroup (Id)
    )
    

    Or, if you have your page names in a table:

    create table UserGroupToPage
    (
        Id int identity(1, 1) primary key,
        PageId int not null foreign key references Pages (Id),
        UserGroupId int not null foreign key references UserGroup (Id)
    )
    

    But - as bic said - you would need to update page names if you change them in your app.