3
Answers

How to assign privileges to employees by using checkbox ?

Roshan George

Roshan George

11y
2k
1

I am creating a web application in asp.net c#.

The project is for assigning tasks to different employees in the system. The project requires that, there are three types of employees, and the privileges corresponding to them are basic, superviser and manager.

The "basic" privilege only has the option to view his/her profile. The "superviser" can create jobs, and when "manager" approves the job, it would become available, and the "superviser" can assign the job to an employee.

As said above, aach of the privileges have a set of avaiable "Actions". My requirement is the following:-

After an employee is created by the admin, the employee need to be given the privileges. The admin can select the privileges (say for example, for basic employee-->view profile, view the work assigned; for superviser--> view profile, create jobs, assign employee to jobs; for manager--> view profile, create job, approve job, assign work to employee; for admin--> all privileges). The admin should be able to "check" the checkboxes associated with each privilegs, and based on these selections, privileges should be assigned to each employee.

How do we do this.

NB:- I dont want to use the "Roles" feature in ASP.NET C#. This is because, only privileges created by the programmer can be used. I want the admin to create roles, by giving a role name, and selecting various privileges.

I have had a look at the features of default asp.net roles and privileges, but my requirement is on the other side of the court.

The project has different users, and I don't want to categorize them as either "basic emp", "hr", "pm", etc. Instead I would prefer to have a seto of checkboxes, and select the required privileges by using the check boxes.

An employee who has been given the privileges by selection of checkboxes can access the corresponding pages.

For example:

I have a set of checkboxes having associated data as:-

-view profile

-edit profile

-create project

-edit project

-upload resume

If I select the checkboxes corresponding to them, the corresponding web pages will be accessible to them.

How is this possible?

Answers (3)