using System; using Umbraco.Core; using Umbraco.Core.Models.Membership; namespace Umbraco.Web.Security { public interface IWebSecurity { /// /// Gets the current user. /// /// The current user. IUser CurrentUser { get; } /// /// Gets the current user's id. /// /// Attempt GetUserId(); /// /// Validates the currently logged in user and ensures they are not timed out /// /// bool ValidateCurrentUser(); /// /// Validates the current user assigned to the request and ensures the stored user data is valid /// /// set to true if you want exceptions to be thrown if failed /// If true requires that the user is approved to be validated /// ValidateRequestAttempt ValidateCurrentUser(bool throwExceptions, bool requiresApproval = true); /// /// Authorizes the full request, checks for SSL and validates the current user /// /// set to true if you want exceptions to be thrown if failed /// ValidateRequestAttempt AuthorizeRequest(bool throwExceptions = false); /// /// Checks if the specified user as access to the app /// /// /// /// bool UserHasSectionAccess(string section, IUser user); /// /// Ensures that a back office user is logged in /// /// bool IsAuthenticated(); } }