I have such Api action method:
[Authorize(Roles = "Admin")]
[HttpGet, Route("")]
public List<TaskViewModel> GetAll()
{
return TasksRepository.SelectAll(Context);
}
and using angular to fetch data through some http service; and have this routing configuration:
$routeProvider.when('/Tasks', {
title: 'Tasks',
controller: 'tCtrlr',
templateUrl: '../HTML/Tasks.html',
})
The problem with that approach is that I cant notify the user that he is getting an empty data because he is not authorized to view its content? so I want to show a message or redirect him to another page, if the API action has Authorize attribute, that the user must be logged in or he cannot view the contents of the page?