Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

SQL Server - Setting up user permissions to view and edit website

Featured Replies

Hi there, I have a website connected to a MS SQL database via ASP connection strings.

 

I want the general public to be able to view the data pulled out from the database and displyed on the website whilst also allowing the site owner to be allowed to edit the inventory in a

 

domain.com/admin/ folder.

 

What permssions and roles do I need to allow.

 

I have created two users in my hosts control panel

 

usera and userb

 

I want usera to only be able to view the website (not edit/delete etc.)

 

and userb to be able to have full admin rights.

 

As it stands both have db_owner privilleges.

 

Do I keep userb on this but amend usera to be just db_datareader and nothing more?

 

In my code I would then link to two different connection paths (one for live site, one for /admin)

 

Any help most welcome, am usually used to just MS Access databasses

Hi Webchap, if usera is the general public/surfers then you dont set anything up in the cpanel - they dont need it.

There are a couple of ways to achieve what you want,

1/ Apache - setting up in cpanel a members/admin area using htaccess passwords

2/ Use the database to store username, password and auth levels of administrators.

 

Either way will work but for me the database is the more logical and easier to manage (in my opinion!)

 

Is that what you are aiming for or have I misinterpretted you?!

  • Author
Hi Webchap, if usera is the general public/surfers then you dont set anything up in the cpanel - they dont need it.

There are a couple of ways to achieve what you want,

1/ Apache - setting up in cpanel a members/admin area using htaccess passwords

2/ Use the database to store username, password and auth levels of administrators.

 

Either way will work but for me the database is the more logical and easier to manage (in my opinion!)

 

Is that what you are aiming for or have I misinterpretted you?!

 

Thanks for the reply. Yes there is already a users table in the database and in the /admin area the first page they come to is a login page. The username and password are entered and they can then enter the admin area and update the site.

 

I once had an SQL Injection attack on a site though so instead of having one connection string for the whole site (surfers and admins) I created two database users. Just wanted to make sure I was doing it right.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.