-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the behavior of User.Load based on the configured DomainUsageP…
…olicy. (#1750) * New api elements and acceptance tests (5/13 reds). * Change the behavior of User.Load based on the configured DomainUsagePolicy.
- Loading branch information
Showing
4 changed files
with
336 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,37 @@ | ||
// ReSharper disable once CheckNamespace | ||
namespace SenseNet.Configuration | ||
{ | ||
/// <summary> | ||
/// Determines domain handling in the login algorithms. | ||
/// Can be configured under the key sensenet/identityManagement/DomainUsagePolicy. | ||
/// The default is "NoDomain". | ||
/// </summary> | ||
public enum DomainUsagePolicy | ||
{ | ||
/// <summary> | ||
/// The domain is optional if the login name is system-wide unique. | ||
/// If not, <see cref="MissingDomainException"/> will be thrown. | ||
/// </summary> | ||
NoDomain, | ||
/// <summary> | ||
/// The default domain will be used if the domain name is not present during logging in. | ||
/// The default is optionally configured under the key sensenet/identityManagement/DefaultDomain. | ||
/// The general default is "BuiltIn". | ||
/// </summary> | ||
DefaultDomain, | ||
/// <summary> | ||
/// This is the most strict policy: the domain name is always required. | ||
/// </summary> | ||
MandatoryDomain | ||
} | ||
public class IdentityManagement : SnConfig | ||
{ | ||
private const string SectionName = "sensenet/identityManagement"; | ||
|
||
public static readonly string BuiltInDomainName = "BuiltIn"; | ||
public static string DefaultDomain { get; internal set; } = GetString(SectionName, "DefaultDomain", BuiltInDomainName); | ||
public static bool UserProfilesEnabled { get; internal set; } = GetValue<bool>(SectionName, "UserProfilesEnabled"); | ||
public static DomainUsagePolicy DomainUsagePolicy { get; set; } = | ||
GetValue<DomainUsagePolicy>(SectionName, nameof(DomainUsagePolicy), DomainUsagePolicy.NoDomain); | ||
public static string DefaultDomain { get; set; } = GetString(SectionName, "DefaultDomain", BuiltInDomainName); | ||
public static bool UserProfilesEnabled { get; set; } = GetValue<bool>(SectionName, "UserProfilesEnabled"); | ||
} | ||
} |
Oops, something went wrong.