0 Replies Latest reply on Jun 7, 2006 4:31 PM by harold69


      I am populating the grid from a query that displays the perosn's name, date of attachment and attachment name, etc etc. I am offering the option to delete these attachments based on two criteria.

      1. The session.role is the administrator role.
      2. The owner of the attachment (the person that put it up) can delete the attachment.

      The problem I am having is that more than one person can add an attachment to the file. I want to be able to limit the items they can delete to those that they put up. Is it possible to cfloop through the grid so if the person is the owner I can give them the check box, if they are not the owner it is inactive. Here is the code I am working with:

      <cfgrid name="attachmentList" query="attachmentsQuery" height="220" rowheaders="false"
      onchange="#launchAttachment#" selectmode="edit">

      <!--- Delete Only If Session. Role is 10 Or session.admin is Owner --->
      <cfif session.role EQ 10>
      <Cfset enable = "yes">
      <cfelseif Session.admin IS #trim(attachmentsQuery.AttachOwner)#>
      <Cfset enable = "yes">
      <Cfset enable = "no">
      <cfgridcolumn name="checked" header="Delete" type="boolean" width="46" display="#enable#"/>
      <cfgridcolumn name="AttachOwner" display="no">
      <cfgridcolumn name="AttachID" display="no">
      <cfgridcolumn name="AttachName" header="Attachment" select="no" />
      <cfgridcolumn name="Name" header="Attached By" select="no" />
      <cfgridcolumn name="DateTimeKey" header="Attach Date" mask="MM/DD/YYYY" select="no" />
      <cfgridcolumn name="AttachmentType" header="Attach Type" select="no" />