Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 6757144a89
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (23 sloc) 0.793 kb
using OpenRasta.OperationModel;
using OpenRasta.OperationModel.Interceptors;
using OpenRasta.Web;
namespace OpenRasta.Security
{
public class RequiresAuthenticationInterceptor : OperationInterceptor
{
readonly ICommunicationContext _context;
public RequiresAuthenticationInterceptor(ICommunicationContext context)
{
_context = context;
}
public override bool BeforeExecute(IOperation operation)
{
if (_context.User == null || _context.User.Identity == null || !_context.User.Identity.IsAuthenticated)
{
_context.OperationResult = new OperationResult.Unauthorized();
return false;
}
return true;
}
}
}
Jump to Line
Something went wrong with that request. Please try again.