samvera / hyrax

Hyrax is a Ruby on Rails Engine built by the Samvera community. Hyrax provides a foundation for creating many different digital repository applications.
http://hyrax.samvera.org/
Apache License 2.0
183 stars 124 forks source link

Depositor should always be able to see their own work #1421

Closed bess closed 6 years ago

bess commented 7 years ago

Descriptive summary

I expect that a depositor should always be able to see their own deposits, even if they haven't yet been approved or activated. Currently (in both Hyrax 1.x and 2.x), once I deposit something I can't see it again until it has been Activated, e.g., by Hyrax::Workflow::ActivateObject

Rationale

As a depositor, I might want to refer to what I deposited, or double-check what I entered.

Expected behavior

After I deposit a work, I expect to be able to go back to it and look at it, but not edit it.

Actual behavior

After I deposit a work, when I return to it I see a message saying "The work is not currently available"

More information

The check happens in app/controllers/concerns/hyrax/curation_concern_controller.rb#document_not_found!. I have been able to produce my desired behavior by overriding that method locally, like this:

    def document_not_found!
      doc = ::SolrDocument.find(params[:id])
      # Render the document if the current_user == the depositor of the document
      return doc if current_user && current_user.user_key == doc["depositor_ssim"].first
      raise WorkflowAuthorizationException if doc.suppressed?
      raise CanCan::AccessDenied.new(nil, :show)
    end

@jeremyf suggests a better approach might be something like:

class DocumentNotFoundPolicy
  def initialize(id:, current_ability:)
  end
  def check!
     raise WorkflowAuthorizationException
     raise CanCan::AccessDenied.new(nil, :show)
  end
end

Then there could be a spec that describes the expected behavior of a document under different states. @mjgiarlo suggests: maybe we want a configuration that determines whether a depositor can always see their own work?

mjgiarlo commented 7 years ago

I wonder if we might want to tweak this search builder module to allow the depositor to see their own works even if they cannot act on them in their current workflow:

https://github.com/samvera/hyrax/blob/a14f72e6073ac0270980060880cb3bd105c9e746/app/search_builders/hyrax/filter_suppressed_with_roles.rb#L15-L31

I'd like @hannahfrost and @vantuyls and @aaron-collier and @samvera/hyrax-repo-managers to sound off on this, because I believe the current behavior (removing the depositor's ability to see a work deposited into a mediated workflow) was originally specified as a requirement. Perhaps any changes made to the above search builder could check a new config/flipper that allows depositors to see their works regardless of current workflow state?

leahvanderjagt commented 7 years ago

IMO depositors should be able to see their works regardless of visibility status when logged in. Otherwise it may feel to them like the deposits are slipping into an unknown, inaccessible place, and they may well occasionally want to go back to check their work or review a deposit (e.g. have I deposited this already?).


Leah VanderjagtDigital Repository Services Coordinator University of Albertat. 780.492.3851 leahv@ualberta.ca leahv@ualberta.ca

On Thu, Aug 3, 2017 at 10:13 AM, Michael J. Giarlo <notifications@github.com

wrote:

I wonder if we might want to tweak this search builder module to allow the depositor to see their own works even if they cannot act on them in their current workflow:

https://github.com/samvera/hyrax/blob/a14f72e6073ac0270980060880cb3b d105c9e746/app/search_builders/hyrax/filter_suppressed_with_roles.rb#L15- L31

I'd like @hannahfrost https://github.com/hannahfrost and @vantuyls https://github.com/vantuyls and @samvera/hyrax-repo-managers https://github.com/orgs/samvera/teams/hyrax-repo-managers to sound off on this, because I believe the current behavior (removing the depositor's ability to see a work deposited into a mediated workflow) was originally specified as a requirement. Perhaps any changes made to the above search builder could check a new config/flipper that allows depositors to see their works regardless of current workflow state?

— You are receiving this because you are on a team that was mentioned. Reply to this email directly, view it on GitHub https://github.com/samvera/hyrax/issues/1421#issuecomment-320017109, or mute the thread https://github.com/notifications/unsubscribe-auth/AFieXEdPCciAGaUbyAJZqNZPnR1qMgB_ks5sUfG7gaJpZM4OsqLt .

vantuyls commented 7 years ago

i agree that depositors should be able to see their own work, even if they cannot take action on it.

i also like that this could be configurable/flippered, given that this visibility behavior may need to differ across institutions or work types.

mjgiarlo commented 7 years ago

Huh. A good question to ask, then, is: does anyone require or prefer the current behavior? Or is that work merely in an intermediate step towards an eventual design? (It could be got things as far as they are now and said, "good enough; let's move on.")

vantuyls commented 7 years ago

I can't think of a real use case for disallowing visibility of a deposited item for the depositor, but others may have thoughts.

leahvanderjagt commented 7 years ago

I agree with Steve but yes there may be other use cases. We've developed under the assumption that depositors can see their items for 10 years. This applies to all our repo environments (eg dataverse)

On Thursday, August 3, 2017, Steve Van Tuyl notifications@github.com wrote:

I can't think of a real use case for disallowing visibility of a deposited item for the depositor, but others may have thoughts.

— You are receiving this because you are on a team that was mentioned. Reply to this email directly, view it on GitHub https://github.com/samvera/hyrax/issues/1421#issuecomment-320033180, or mute the thread https://github.com/notifications/unsubscribe-auth/AFieXMvIRvTCcPVpaO97RE7vqHMU78o3ks5sUgAPgaJpZM4OsqLt .

--


Leah VanderjagtDigital Repository Services Coordinator University of Albertat. 780.492.3851 leahv@ualberta.ca leahv@ualberta.ca

julesies commented 7 years ago

agree with allowing depositors to see their works. We definitely have the use case for depositors not to edit or remove their works, but seeing them is not a problem.

mjgiarlo commented 7 years ago

OK, thanks, all. Assuming @hannahfrost and @aaron-collier are also cool with this, it seems to me we should be changing the default behavior to allow depositors to see their deposited works (rather than making this configurable, unless we know for sure someone needs this).

hannahfrost commented 7 years ago

I am cool with a depositor having the ability to read their deposit while it is in workflow.

mjgiarlo commented 7 years ago

OK, it seems there is (sufficient) consensus for now, so I'm marking this issue as ready for the 2.0.0 milestone.

mjgiarlo commented 7 years ago

Thx to @bess for getting this started!

lsitu commented 6 years ago

@bess Do you know what's the status of the ticket?

bess commented 6 years ago

I think this still isn't fixed. If I deposit a work into a workflow where it needs approval, I can't see it in "My Works" until it's been approved. I also can't find it via search results. This means users think that they haven't submitted their work.