dr-itz / redmine_workflow_enhancements

Redmine workflow enhancements. UNMAINTAINED
GNU General Public License v2.0
27 stars 29 forks source link

Adding permition to show_graph #10

Closed victorlcampos closed 9 years ago

victorlcampos commented 9 years ago

Hi, We doesn't want that all rules can watch all Workflow, so I add a permiton to this

dr-itz commented 9 years ago

Hi. I think that's a good idea. But it needs a little more work.

  1. This causes one test to fail:

    rake redmine:plugins:test NAME=redmine_workflow_enhancements
    ...
     1) Failure:
    IssuesControllerTest#test_show_by_manager [.../redmine/plugins/redmine_workflow_enhancements/test/functional/issues_controller_test.rb:36]:
    Expected at least 1 element matching "#workflow-display", found 0..
    Expected 0 to be >= 1.
    ...

    Could you fix that by doing the following?

    • Fix the breaking test by giving the user the permission
    • Add a new test without giving the user the permission to check that it doesn't show the workflow

    To add a permission in the test, you can basically do something like this:

    Role.find(1).add_permission! :view_enhancements_graph
  2. Please rename the permission to something more descriptive like :workflow_graph_view or something.
  3. Add a string to config/locales/en.yml

    Redmine defines the convention permission_ plus the name of the permission. It then just works. So something like

    en:
     permission_workflow_graph_view: "View workflow graph"

Thanks.

victorlcampos commented 9 years ago

Ok =)

victorlcampos commented 9 years ago

Done =)

raphamorim commented 9 years ago

+1

dr-itz commented 9 years ago

Thanks, looks good now :)

I merged it, but folded the three commits into one with a slightly different log message (with you as author of course). On top of that I moved the permission to the "Issue Tracking" category of the role.

victorlcampos commented 9 years ago

It's ok for me, thx for awesome project