programming4us
programming4us
DATABASE

SQL Server :ONE-WAY ENCRYPTION - Creating the Interface (part 2) - Setting and Verifying Permissions to the Stored Procedures

- How To Install Windows Server 2012 On VirtualBox
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire

Setting and Verifying Permissions to the Stored Procedures

Once the stored procedures have been created, we need to grant the appropriate permissions to them (see Listing 6). With the HomeLending database we will be operating on the assumption that the Sensitive_high database role will have access to the information that will be inserted and updated to the Borrower_Identification table.

The ability to search the data that is in the Borrower_Identification table will be granted to the Sensitive_high and Sensitive_medium database roles, due to our use of the Identification_Value_HT column that contains a hash value of the last four digits of our original plain text.

Listing 6. Setting permissions to the stored procedures.

Now that our stored procedures have been created we will want to verify that the permissions are effective, using of EXECUTEASUSER to impersonate a member of the various database roles. The use of REVERT terminates the impersonation and returns us to our original user account.

Listing 7 executes the Search_Borrower_Identification stored procedure with the plain text value of "0143", which is the last four digits of a known Social Security Number, being passed as its argument.

Listing 7. Verifying permissions.

The result of this verification will reflect that rows were returned for the queries for the Sensitive_high and Sensitive_medium members; but since permissions did not exist for the Sensitive_low members the actual rows will not be returned. Instead the following will appear:



To view the actual rows returned, execute each batch in this script individually.

Other  
  •  SQL Server : Implementing One-Way Encryption (part 1) - Populate the Hash Columns, Verify the Implementation, Drop the Unencrypted Column
  •  SQL Server : Implementing One-Way Encryption (part 1) - Create the Primary Hash Column,Create a Secondary Hash Column for Searching
  •  Sql Server 2012 : Hierarchical Data and the Relational Database - Hierarchical Table Indexing Strategies
  •  Sql Server 2012 : Hierarchical Data and the Relational Database - Populating the Hierarchy (part 3) - The GetAncestor Method
  •  Sql Server 2012 : Hierarchical Data and the Relational Database - Populating the Hierarchy (part 2) - The ToString Method
  •  Sql Server 2012 : Hierarchical Data and the Relational Database - Populating the Hierarchy (part 1)
  •  Sql Server 2012 : Hierarchical Data and the Relational Database - The hierarchyid Data Type, Creating a Hierarchical Table
  •  Personal Cloud WD My Cloud EX2 Review
  •  Synology DS213j Your Own Cloud Entertainment Starts Here
  •  ADATA Premier Pro SP920 256GB
  •  
    Top 10
    - Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
    - Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
    - Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
    - Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
    - Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
    - Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
    - Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
    - Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
    - Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
    - Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
    REVIEW
    - First look: Apple Watch

    - 3 Tips for Maintaining Your Cell Phone Battery (part 1)

    - 3 Tips for Maintaining Your Cell Phone Battery (part 2)
    programming4us programming4us
    programming4us
     
     
    programming4us