public Attachment Get(string attId, User subject) { if (!membershipInterface.IsReader(attId, subject)) { throw new NotAuthorized(); } return(attachmentInterface.GetById(attId)); }
public void CreateAttachmentTest2() { string attName = "New Attachment"; var att = attachmentInterface.Create(attName, attTestContext.pages[0], attTestContext.users[0]); var fetched = attachmentInterface.GetById(att.Id); Assert.NotNull(fetched); Assert.Equal(att.Id, fetched.Id); Assert.Equal(attName, fetched.Name); Assert.Equal(fetched.Acl.ownerId, attTestContext.users[0].Id); Assert.Equal(fetched.ParentId, attTestContext.pages[0].Id); }