2 // System.Web.Configuration.RoleManagerSection
5 // Chris Toshok (toshok@ximian.com)
7 // (C) 2005 Novell, Inc (http://www.novell.com)
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 using System.ComponentModel;
33 using System.Configuration;
34 using System.Web.Security;
38 namespace System.Web.Configuration {
40 public sealed class RoleManagerSection : ConfigurationSection
42 [ConfigurationProperty ("cacheRolesInCookie", DefaultValue = false)]
43 public bool CacheRolesInCookie {
44 get { return (bool) base ["cacheRolesInCookie"]; }
45 set { base ["cacheRolesInCookie"] = value; }
48 [TypeConverter (typeof (WhiteSpaceTrimStringConverter))]
49 [StringValidator (MinLength = 1)]
50 [ConfigurationProperty ("cookieName", DefaultValue = ".ASPXROLES")]
51 public string CookieName {
52 get { return (string) base ["cookieName"]; }
53 set { base ["cookieName"] = value; }
56 [TypeConverter (typeof (WhiteSpaceTrimStringConverter))]
57 [StringValidator (MinLength = 1)]
58 [ConfigurationProperty ("cookiePath", DefaultValue = "/")]
59 public string CookiePath {
60 get { return (string) base ["cookiePath"]; }
61 set { base ["cookiePath"] = value; }
64 [ConfigurationProperty ("cookieProtection", DefaultValue = "All")]
65 public CookieProtection CookieProtection {
66 get { return (CookieProtection) base ["cookieProtection"]; }
67 set { base ["cookieProtection"] = value; }
70 [ConfigurationProperty ("cookieRequireSSL", DefaultValue = false)]
71 public bool CookieRequireSSL {
72 get { return (bool) base ["cookieRequireSSL"]; }
73 set { base ["cookieRequireSSL"] = value; }
76 [ConfigurationProperty ("cookieSlidingExpiration", DefaultValue = true)]
77 public bool CookieSlidingExpiration {
78 get { return (bool) base ["cookieSlidingExpiration"]; }
79 set { base ["cookieSlidingExpiration"] = value; }
82 [TypeConverter (typeof (TimeSpanMinutesOrInfiniteConverter))]
83 [PositiveTimeSpanValidator]
84 [ConfigurationProperty ("cookieTimeout", DefaultValue = "30")]
85 public TimeSpan CookieTimeout {
86 get { return (TimeSpan) base ["cookieTimeout"]; }
87 set { base ["cookieTimeout"] = value; }
90 [ConfigurationProperty ("createPersistentCookie", DefaultValue = false)]
91 public bool CreatePersistentCookie {
92 get { return (bool) base ["createPersistentCookie"]; }
93 set { base ["createPersistentCookie"] = value; }
96 [TypeConverter (typeof (WhiteSpaceTrimStringConverter))]
97 [StringValidator (MinLength = 1)]
98 [ConfigurationProperty ("defaultProvider", DefaultValue = "AspNetSqlRoleProvider")]
99 public string DefaultProvider {
100 get { return (string) base ["defaultProvider"]; }
101 set { base ["defaultProvider"] = value; }
104 [ConfigurationProperty ("domain")]
105 public string Domain {
106 get { return (string) base ["domain"]; }
107 set { base ["domain"] = value; }
110 [ConfigurationProperty ("enabled", DefaultValue = false)]
111 public bool Enabled {
112 get { return (bool) base ["enabled"]; }
113 set { base ["enabled"] = value; }
116 [ConfigurationProperty ("maxCachedResults", DefaultValue = 25)]
117 public int MaxCachedResults {
118 get { return (int) base ["maxCachedResults"]; }
119 set { base ["maxCachedResults"] = value; }
122 [ConfigurationProperty ("providers")]
123 public ProviderSettingsCollection Providers {
124 get { return (ProviderSettingsCollection) base ["providers"]; }