&& (this.Name == null || other.Name.StartsWith(this.Name));
}
+ public bool IsWritable(string account)
+ {
+ //If the Allowed To header has no value, try to determine the Share permissions
+ if (AllowedTo == null)
+ {
+ //If this file has no permissions defined, we can probably write it
+ //This case should occur only when the info comes from a listing of the user's own files
+ if (Permissions == null || Permissions.Count == 0)
+ return true;
+ string perms;
+
+ //Do we have an explicit write share to this account?
+ return Permissions.TryGetValue(account, out perms)
+ && perms.Equals("write",StringComparison.InvariantCultureIgnoreCase);
+
+ }
+ //Otherwise return the permissions specified by AllowedTo
+ return AllowedTo.Equals("write",StringComparison.InvariantCultureIgnoreCase) ;
+ }
public ObjectInfo Previous { get; private set; }
{
get
{
+ if (Content_Type == null)
+ return false;
if (Content_Type.StartsWith(@"application/directory",StringComparison.InvariantCultureIgnoreCase))
return true;
if (Content_Type.StartsWith(@"application/folder",StringComparison.InvariantCultureIgnoreCase))