User Permissions

User Permissions

Happy Saturday ! This morning I finished up a page on the website I’m creating that allows an administrator to change a user’s settings and access on the website. I created the page to load the user’s current settings from the SQL database and display them. Once the changes are saved, those changes are then updated in the database.

To properly update the site’s event log, I used multiple Session[] statements and a nested if/else statement to check if the “changes” being saved are the exact same as the data already in the database. If so, a message is displayed to the user that no changes have been made and the site’s event log is not updated. Otherwise, i update the site log stating that a change has been made to the user’s access and also state who made the change (by displaying their login name).

Originally, i tried to do this using a SQLDataReader() but it wasn’t working because i guess when saved, it updated the database with the new data before the reader could read/compare the old data. But, after deciding to sleep on it and try again another time, the idea to try Session[] statements dawned on me this morning and it worked like a charm!

If anyone has other techniques that you think i should try on my website or any other comments please feel free to share with me.

Next up, working on the Reset/Forgot Password pages !


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s