Exemple #1
0
        public void CreateEventUserDownloadBlob(User user, Blob blob, RequestData request)
        {
            BlobEvent @event = new BlobEvent()
            {
                BlobEventId = Guid.NewGuid(),
                EventDateTime = DateTime.UtcNow,
                EventType = (int)EventType.Download,
                User = user,
                Blob = blob
            };

            CompleteBlobEvent(@event, request);

            this.context.BlobEvents.AddObject(@event);
            this.context.SaveChanges();
        }
        public Permission GrantPermissionToUserBlob(Privilege privilege, User user, Blob blob, DateTime expiration)
        {
            var permission = new Permission()
            {
                PermissionId = Guid.NewGuid(),
                Privilege = (int)privilege,
                Blob = this.context.Blobs.Single(br => br.BlobId == blob.BlobId),
                CreationDateTime = DateTime.UtcNow,
                ExpirationDateTime = expiration
            };

            permission.Users.Add(this.context.Users.Single(u => u.UserId == user.UserId));
            this.context.Permissions.AddObject(permission);
            this.context.SaveChanges();

            return permission;
        }
        public Permission GrantPermissionToRoleBlob(Privilege privilege, Role role, Blob blob, DateTime expiration)
        {
            var permission = new Permission()
            {
                PermissionId = Guid.NewGuid(),
                Privilege = (int)privilege,
                Blob = blob,
                CreationDateTime = DateTime.UtcNow,
                ExpirationDateTime = expiration
            };

            permission.Roles.Add(this.context.Roles.Single(r => r.RoleId == role.RoleId));
            this.context.Permissions.AddObject(permission);
            this.context.SaveChanges();

            return permission;
        }
Exemple #4
0
 public void CreateEventUserDownloadBlob(string nameIdentifier, string identityProvider, Blob blob, RequestData request)
 {
     User user = this.userService.RetrieveUserByNameIdentifier(nameIdentifier, identityProvider);
     this.CreateEventUserDownloadBlob(user, blob, request);
 }
Exemple #5
0
 public void CreateEventUserDownloadBlob(string nameIdentifier, string identityProvider, Blob blob)
 {
     this.CreateEventUserDownloadBlob(nameIdentifier, identityProvider, blob, this.GetRequestData());
 }
Exemple #6
0
 public void CreateEventUserDownloadBlob(User user, Blob blob)
 {
     this.CreateEventUserDownloadBlob(user, blob, this.GetRequestData());
 }
Exemple #7
0
 public Guid UploadBlob(Blob blob, System.IO.Stream stream)
 {
     throw new NotImplementedException();
 }
Exemple #8
0
 public Guid UploadBlob(Blob blob, string filePath)
 {
     throw new NotImplementedException();
 }
Exemple #9
0
 public string GetBlobName(Blob blob)
 {
     throw new NotImplementedException();
 }
Exemple #10
0
 public string GetContentType(Blob blob)
 {
     throw new NotImplementedException();
 }
Exemple #11
0
 public CloudBlob GetBlob(Blob blob)
 {
     return new CloudBlob("http://localhost:10002/blob.jgp");
 }
Exemple #12
0
 public Guid CreateBlob(Blob blob)
 {
     throw new NotImplementedException();
 }
        private Blob GetTestBlob(BlobShareDataStoreEntities context)
        {
            Blob blob = new Blob()
            {
                BlobId = Guid.NewGuid(),
                Name = "Test Blob Resource",
                OriginalFileName = "originalfile.txt",
                UploadDateTime = DateTime.UtcNow
            };

            context.Blobs.AddObject(blob);

            return blob;
        }
 /// <summary>
 /// Create a new Blob object.
 /// </summary>
 /// <param name="blobId">Initial value of the BlobId property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="originalFileName">Initial value of the OriginalFileName property.</param>
 /// <param name="uploadDateTime">Initial value of the UploadDateTime property.</param>
 public static Blob CreateBlob(global::System.Guid blobId, global::System.String name, global::System.String originalFileName, global::System.DateTime uploadDateTime)
 {
     Blob blob = new Blob();
     blob.BlobId = blobId;
     blob.Name = name;
     blob.OriginalFileName = originalFileName;
     blob.UploadDateTime = uploadDateTime;
     return blob;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Blobs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToBlobs(Blob blob)
 {
     base.AddObject("Blobs", blob);
 }