Last post Apr 22, 2015 01:45 PM by bbcompent1
Apr 21, 2015 01:09 AM|bijaykush|LINK
I am new to this asp.net and SQL. Here, i want to create a new role called "Employee_Delete" by using SQL server management studios. i have already database "payroll "and a table called "aspnet_Roles" where all the roles ate listed. I Want this newly created
role to appear in the same list. And then, When a user is assigned this role, then he would be able to delete the existing employee. And also the process to define that role so that it can perform its task i.e in this case deletion.
I have gone through googling this problem but didn't get this exactly. Any help would be appreciated.
Apr 21, 2015 11:30 AM|bbcompent1|LINK
bijaykush, there is a much simpler way to handle this. Instead of creating a new table for every role function, I would recommend have those roles in the user table and make each role a Boolean field. This way, you do not have to build extra tables and
you will not need to query multiple tables. The schema would look something like this:
Once you have configured your security levels in this fashion, you should be able to do what you need to. Hope that helps.
Apr 22, 2015 05:01 AM|Edwin Guru Singh|LINK
When a user is assigned this role, then he would be able to delete the existing employee. And also the process to define that role so that it can perform its task i.e in this case deletion
for your reference, you can try the below table structure :
create table aspnet_Roles(
RoleId int primarykey,
create table tblUser(
UserId int primarykey,
Create table UserRole(
URId int primary key,
fk_UserId int foreign key references tblUser(UserId),
fk_RoleId int foreign key references aspnet_Roles(RoleId),
RoleStatus bit, --1.Enable,0.Disable
CreatedBy varchar(50), --Give permission to do by Admin only
Apr 22, 2015 01:45 PM|bbcompent1|LINK
I agree with Edwin, you can say it is delete however in reality you would be simply disabling the account, using a Boolean value for the disablement.