* AuthorizationRule.cs (CheckUser): handle * and ?, and use
String.Compare instead of ==.
(CheckVerb): use String.Compare instead of ==.
* AuthorizationSection.cs (IsValidUser): return false for a null
user.
svn path=/trunk/mcs/; revision=56052
internal bool CheckVerb (string verb)
{
foreach (string v in Verbs) {
internal bool CheckVerb (string verb)
{
foreach (string v in Verbs) {
+ if (String.Compare (v, verb, true) == 0)
return true;
}
return false;
return true;
}
return false;
internal bool CheckUser (string user)
{
foreach (string u in Users) {
internal bool CheckUser (string user)
{
foreach (string u in Users) {
+ if (String.Compare (u, user, true) == 0 ||
+ u == "*" ||
+ (u == "?" && user == ""))
return true;
}
return false;
return true;
}
return false;
internal bool IsValidUser (IPrincipal user, string verb)
{
internal bool IsValidUser (IPrincipal user, string verb)
{
+ if (user == null)
+ return false;
+
foreach (AuthorizationRule rule in Rules) {
if (!rule.CheckVerb (verb))
continue;
foreach (AuthorizationRule rule in Rules) {
if (!rule.CheckVerb (verb))
continue;
+2006-01-25 Chris Toshok <toshok@ximian.com>
+
+ * AuthorizationRule.cs (CheckUser): handle * and ?, and use
+ String.Compare instead of ==.
+ (CheckVerb): use String.Compare instead of ==.
+
+ * AuthorizationSection.cs (IsValidUser): return false for a null
+ user.
+
2006-01-22 Chris Toshok <toshok@ximian.com>
* GlobalizationSection.cs (VerifyData): quiet mcs.
2006-01-22 Chris Toshok <toshok@ximian.com>
* GlobalizationSection.cs (VerifyData): quiet mcs.