title: Ng-hide or ng-show based on user roles
body: <p>Good morning developers, </p>
  
  <p>I have been instructed to assign user roles to specific views. I got three roles:</p>
  
  <ul>
  <li>Power user ( can edit, can delete) </li>
  <li>Viewer(no edit, no delete)</li>
  <li>Basic (no edit)</li>
  </ul>
  
  <p>This is what I got in code:</p>
  
  <p><strong>HTML5 and AngularJS:</strong></p>
  
  <pre><code>&lt;button ng-click="vm.openSettings(vm.selected, $event)" class="btn btn-default"  ng-hide="vm.viewmode === 1 || !vm.selected" &gt;&lt;i class="fa fa-cog"&gt;&lt;/i&gt;&amp;nbsp;Settings&lt;/button&gt;
  &lt;button ng-click="vm.deleteProject(vm.selected, $event)" class="btn btn-default" ng-hide="vm.viewmode === 1 || !vm.selected" &gt;&lt;i class="fa fa-trash-o"&gt;&lt;/i&gt;&amp;nbsp;Delete&lt;/button&gt;`
  </code></pre>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>function getUsers() {
      var d = $q.defer();
      var url = '/api/sso/getusers';
      $http.get(url)
          .success(function (data, status, headers, config) {
             d.resolve(data);
          })
          .error(function (data, status, headers, config) {
             logger.error(data);
             d.reject();
          });
       return d.promise;
    }
  </code></pre>
  
  <p>How can I hide the delete and edit button based on the user roles in the database?</p>