{"id":1238,"date":"2008-07-08T03:45:29","date_gmt":"2008-07-08T08:45:29","guid":{"rendered":"http:\/\/www.mrc-productivity.com\/legacy\/?page_id=1238"},"modified":"2018-01-05T08:58:51","modified_gmt":"2018-01-05T14:58:51","slug":"row-level-security","status":"publish","type":"page","link":"https:\/\/www.mrc-productivity.com\/legacy\/security\/row-level-security","title":{"rendered":"Row Level Security"},"content":{"rendered":"<p><!-- Begin Content --><\/p>\n<h1>Row Level Security for m-Power Applications<\/h1>\n<p>Row Level Security is a highly flexible technique for controlling which records are returned based on the current user. The following few steps demonstrate the technique.<\/p>\n<p>Create a security table and populate it with data. It may contain several records per user.<\/p>\n<p><strong>Note: <\/strong>You must enter the username in ALL UPPERCASE. Doing this will allow for the end user to be non-case specific at run-time.<\/p>\n<p>This example has fields Profile (10A), Relationship (2A), and Values (99A). Valid values for the Relationship field include:<\/p>\n<ul>\n<li class=\"padleft\"><strong>EQ<\/strong> Equal to<\/li>\n<li class=\"padleft\"><strong>GE<\/strong> Greater than or equal to<\/li>\n<li class=\"padleft\"><strong>GT<\/strong> Greater than<\/li>\n<li class=\"padleft\"><strong>LE<\/strong> Less than or equal to<\/li>\n<li class=\"padleft\"><strong>LS<\/strong> Is in the list<\/li>\n<li class=\"padleft\"><strong>LT<\/strong> Less than<\/li>\n<li class=\"padleft\"><strong>NE<\/strong> Not equal to<\/li>\n<li class=\"padleft\"><strong>NG<\/strong> Not greater than<\/li>\n<li class=\"padleft\"><strong>NL<\/strong> Not less than<\/li>\n<li class=\"padleft\"><strong>RG<\/strong> Is in the range<\/li>\n<li class=\"padleft\"><strong>SW<\/strong> Starts with<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.mrc-productivity.com\/legacy\/images\/maintainer_add_sec_values1.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"660\" height=\"269\" class=\"alignnone size-full wp-image-5181\" alt=\"maintainer_add_sec_values\" src=\"https:\/\/www.mrc-productivity.com\/legacy\/images\/maintainer_add_sec_values1.jpg\" srcset=\"https:\/\/www.mrc-productivity.com\/legacy\/images\/maintainer_add_sec_values1.jpg 660w, https:\/\/www.mrc-productivity.com\/legacy\/images\/maintainer_add_sec_values1-150x61.jpg 150w, https:\/\/www.mrc-productivity.com\/legacy\/images\/maintainer_add_sec_values1-300x122.jpg 300w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/a><\/p>\n<p>Create a retrieval over this security table.<\/p>\n<p><img decoding=\"async\" alt=\"Security advanced record.bmp\" src=\"\/legacy\/images\/advrcdlvlsec2.jpg\" \/><\/p>\n<p>Here is the listing of all the fields used in the retrieval application. Sequence your application by the field containing user profile (USERNAME in this case). Please do not name the user field USER. That is a reserved Java field.<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"\/legacy\/images\/advrcdlvlsec3.jpg\" \/><\/p>\n<p>Select the <em>Row Level Security<\/em> template in the \u2018Application Settings\u2019 link from the \u2018Application Menu\u2019 screen. Click the Accept button to save your changes and compile your application. This specific template tells m-Power that this application contains security credential information. Further, by selecting this template, you allow future applications to apply this security via the Record \u00a0Selections Screen.<\/p>\n<p><a href=\"#Video\"><iframe loading=\"lazy\" id=\"Video\" src=\"https:\/\/www.youtube.com\/embed\/wnAMlQcqCGo\" height=\"315\" width=\"560\" allowfullscreen=\"\" frameborder=\"0\"><\/iframe><\/a><\/p>\n<p class=\"scriptbutton\">\n<input id=\"script1\" class=\"toggleScript\" type=\"button\" value=\"Show Video Script\" \/>\n<\/p>\n<p class=\"script script1\">\nIn this brief video I will show you how to apply Row Level security to your applications.<br \/>\n<br \/>\nRow level security is a great feature that allows you to specify what records your users can access based on their login credentials. This gives you great control over who can access the records and what records they can access.<br \/>\n<br \/>\nOnce the security table and the Row Level Security retrieval have been created, you are ready to apply the Row Level security to your application.<br \/>\n<br \/>\nAs you can see, I have a report listing all the customers; there are over two hundred records listing customers from many different States and regions. I am assigned to work only with customers from the Midwest, which includes these four states: OH, IL, IA, and IN. There is no need for me to see records of customers from other states.<br \/>\n<br \/>\nIn the security retrieval I had filtered that my user \u201cZarate\u201d should only be able to access the records where the State is equal to any of these: OH, IL, IA, and IN.<br \/>\n<br \/>\nAfter compiling your application, click Record Selections.  From the Field drop down, select the field that you want to control. In my case the field is the Customer state.<br \/>\n<br \/>\nFrom the Selections drop down, select the Row Level Security.  From the Values drop down, select the retrieval containing the users and filters for this application. In my case the retrieval 20 contains the filters of what records I can access depending on the user.<br \/>\n<br \/>\nRecompile the application without overriding the HTML or Properties.  Now, when I run the application I am only allowed to access those records that match my filter on the retrieval.<\/p>\n<p>The above video explains how to integrate the security retrieval we created above with each application you wish to secure.<\/p>\n<p>For users unable to watch the video, you need to go into the application that will be secured. In our case, lets assume it is a Report. Go into Record Selections, and select &quot;Row Level Security&quot; from the &quot;Relation&quot; drop-down. Next, in the value drop-down, you will see a list of all Row Level Security retrievals that have been built in this dictionary. Select the appropriate one and compile. (There is no need to overwrite the HTML).<\/p>\n<p><em>Editor&#39;s Note<\/em>: When creating the Row Level Security template, please ensure that the 3rd column listed in the column you wish to secure against.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Row Level Security for m-Power Applications Row Level Security is a highly flexible technique for controlling which records are returned based on the current user. The following few steps demonstrate the technique. Create a security table and populate it with data. It may contain several records per user. Note: You must enter the username in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1227,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1238","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/1238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/comments?post=1238"}],"version-history":[{"count":38,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/1238\/revisions"}],"predecessor-version":[{"id":8787,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/1238\/revisions\/8787"}],"up":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/1227"}],"wp:attachment":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/media?parent=1238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}